Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

FileNotFoundException invoked when ran un IDE but not when built to Jar and run in Minecraft Forge


Recommended Posts

IDE: IntelliJ 2020.2.3

JDK: 1.8.0_291

 

For every single one of my textures- let me rephrase: for every single file that is inside my resources folder cannot be found. Let me rephrase again: Every single file inside my resources folder invokes a FileNotFoundException when ran on IntelliJ IDE. That's the weird part: it's only invoked when run on IntelliJ. When I build it to a Jar file and then I put it in my mods folder and run it on regular Minecraft Forge, all the textures and names load up perfectly. So far I've been just exporting and running my mod whenever I want to test some sort of code, but it's getting exhausting and it's wasting my time considerably. How come I only get this error when I run it on IntelliJ? Is there some sort of project setting I have to change in order to get it to work?

Link to post
Share on other sites
14 hours ago, kiou.23 said:

refresh the gradle project

re-run genIntelliJRuns

post your build.gradle

1. Done: nothing changed

2. What do you mean by re-run genIntelliJRuns?

Link to post
Share on other sites
Posted (edited)
16 minutes ago, L0raxeo said:

2. What do you mean by re-run genIntelliJRuns?

Quote

For IntelliJ, run the genIntellijRuns gradle task (gradlew genIntellijRuns). This will generate the Run Configurations and download any required assets for the game to run. After this has finished edit your Configurations to fix the “module not specified” error by changing selecting your “main” module.

From the getting started documentation: https://mcforge.readthedocs.io/en/1.16.x/gettingstarted/

 

Also, post your build.gradle

or if possible a repository

Edited by kiou.23
Link to post
Share on other sites
Just now, diesieben07 said:

It's a gradle task.

do I run it in powershell? To build my files I just do .\gradlew build
do I do .\gradlew genIntelliJRuns?

Link to post
Share on other sites
Just now, diesieben07 said:

Yes.

just to make sure, this won't mess up any of my setup right? I spent 7 hours trying to get this to work while combing through errors and I do not feel obligated to do it again....

Link to post
Share on other sites

o.O What on earth are you doing that it takes you 7 hours setting up the MDK? All you need to do is unpack the MDK and import the build.gradle in your IDE.

Link to post
Share on other sites
Posted (edited)
2 minutes ago, diesieben07 said:

o.O What on earth are you doing that it takes you 7 hours setting up the MDK? All you need to do is unpack the MDK and import the build.gradle in your IDE.

It was insane. The gradle versions were off then Eclipse couldn't run the VM or something like that and then my JDK was corrupted and I switched to IntelliJ which had problems with the environment variables and then the JAVA_OPTIONS and JAVA_HOME were causing problems so I had to switch versions and oh man it was honestly a nightmare- but worth it :) im having a lot of fun coding my poop mod

Edited by L0raxeo
Link to post
Share on other sites
Just now, diesieben07 said:

This is why the MDK comes with a gradle wrapper.

yeah well it wasn't working for some reason. Either way, I just ran that command and it said it built successfully. unfortunately I still got the error when running it

 

Link to post
Share on other sites
2 minutes ago, diesieben07 said:

How exactly are you starting the mod from IntelliJ? Post a Git repo of your mod.

I'm just pressing the run button. everything works- all the functionalities and everything, it's just getting a file not found exception. Here is a link to the error I'm getting in case you need an aid

https://hatebin.com

Link to post
Share on other sites
2 minutes ago, L0raxeo said:

I'm just pressing the run button. everything works

How did you get the run configuration? If you never ran genIntellijRuns before then it is most likely not correct.

You linked to the hatebin home page...

Link to post
Share on other sites
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.