NoClassDefFoundError when launching in game, works fine in IntelliJ #4020
-
DescriptionAfter fixing the problem with the mixin I had, I have now run into another problem: https://pastebin.com/D92Q4bTC When I try to launch it in game, it crashes with this error. However, it doesn't crash in the IDE I'm using (IntelliJ), and works perfectly. Would this be a problem with the way it's being built? For more debugging, please notify me of what files I should send. I'm not sure if this is the right place to ask as I'm new to all of this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It doesn't crash in your IDE because Gradle pulls in all the dependencies for you. There are two ways to package dependencies:
Gradle Shadow is harder to setup, requiring much more knowledge of Gradle and Loom. It's mainly good for packaging dependencies that aren't mods, and have many dependencies of their own. |
Beta Was this translation helpful? Give feedback.
It doesn't crash in your IDE because Gradle pulls in all the dependencies for you.
However those dependencies do not get put in the built JAR unless you specifically ask for that, because often that's not what you want.
There are two ways to package dependencies:
include
Gradle configuration (a.k.a. jar-in-jar).include
is the easiest to use, and the best option for packaging mods. It also works well for non-mod dependencies that have few dependencies of their own. The typical issues people have are: