Re: Creating an executable .jar file
Posted by
Wade Walker on
Jun 04, 2011; 3:15am
URL: https://forum.jogamp.org/Creating-an-executable-jar-file-tp3011748p3022190.html
Worker wrote
Make it simpler.
Take the program power archiver from the net.
PowerArchiver doesn't help with the original poster's question. Creating the JAR is the easy part -- you can do that with many different programs. Even the "jar" program that ships with Java works fine for this

The problem comes when you try to run a JOGL program from a JAR. You have to pull the JOGL DLL/SO files out of the JAR at runtime, then copy them to a directory on the filesystem that's on the java.library.path. If you don't do this, the loadLibrary() calls in JOGL won't work, and your program won't run.
SWT solves this problem by unpacking its own DLL/SO files the first time you call into the SWT library. JOGL requires that some outside code (either Eclipse RCP, some custom code of your own, or some other framework like Java Web Start) has unpacked the DLL/SO files, so JOGL just calls loadLibrary() and assumes it will work.