Login  Register

Creating an executable .jar file

Posted by AlexRNL on Jun 01, 2011; 5:10pm
URL: https://forum.jogamp.org/Creating-an-executable-jar-file-tp3011748.html

Hi everyone!

I'm currently working on a JOGL (1.1) app and i want to make a jar file so it can be deployed on other computers easily.

Unfortunately, it's not working.

I'm using the "export tool" in eclipse but as soon as i want to launch my jar (from the command line, with java -jar myJar.jar) i'm getting a very mysterious output :

Exception in thread "main" java.lang.NoSuchMethodError: javax.media.opengl.GLDrawableFactory.getFactory()Ljavax/media/opengl/GLDrawableFactory;
        at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java
:520)
        at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131)
        at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90)
        at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:83)
        at sytar.sample.SwingRTLauncher.main(SwingRTLauncher.java:69)

It seems that my libs are not correctly copied by eclipse into the jar... but when I decompile the javax.media.opengl.GLDrawableFactory.class file in the jar, the function was available!!

Now, I've tried using the -Djava.library.path=mypath but it wasn't working either...

And the strangest thing is when I tried that with a JOGL 2.0 project, it was working very well... but unfortunately, I'm required to use JOGL 1.1 for that project...

Thanks in advance for any clue that'll help solve my problem :)
Alex.