Creating an Executable Jar

Started by coinklepto, August 23, 2021, 02:52:17

Previous topic - Next topic

coinklepto

Hello!

I'm trying to create an executable jar for my LWJGL application, but I've run into a problem. I can create the executable jar fine using files generated from the Eclipse IDE, and putting the necessary LWJGL jar libraries in the executable jar. However, Eclipse generates a custom class loader "Jar-In-Jar" (not sure on the specifics) which has the effect of breaking any part of my code that uses the
Class.getResource(String)
method. So I'm guessing there are two possible ways to handle this: call some other method or use the method in a different way for it to run properly, or extract the files from the jar libraries into the executable jar (I read this is called a "fat jar"?). In either case, I don't know how to solve this problem since I've never made an executable jar using libraries before. I'm hoping that someone here has the experience of doing this and can teach me how.

Thanks,
   Alec