I really don't understand how this works. I'm trying to build a .jar right now. It consists of two classes: Test.class and Sayer.class. And it works just fine if I access Test.class directly, or properly pack Test.jar, but the only way I can get a jar to execute is if I pack it with a manifest (jar cfm Test.jar manifest Test.class Sayer.class).
If I don't do that, I get an error when trying to run the jar: Error: Invalid or corrupt jarfile Test.jar. This also happens if I build the "good" jar, and remove META-INF/
This perfectly makes sense on its own. After all, you need some way of telling Java where to look for the entry point...right? But then you have Minecraft's modding community, which routinely recommends removing META-INF to make a given mod work.
But, how is Minecraft able to function without a META-INF folder? According to my experiments, this shouldn't even be possible. Shouldn't this corrupt minecraft.jar just like it corrupted my Test.jar?
Since MineCraft is run from a launcher, the launcher itself can pass the appropriate startup class to Java directly without needing a META-INF folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With