Login  Register

Re: JOGL 2.3 - eporting jogl project to executable jar file

Posted by Xerxes Rånby on Aug 20, 2015; 7:57am
URL: https://forum.jogamp.org/JOGL-2-3-exporting-jogl-project-to-executable-jar-file-tp4035073p4035071.html

miradnil wrote
Hello, I am trying to export my jogl project to executable jar file (I believe you call it fat-jar).
"fat-jar" is one single jogamp jar using the name jogamp-fat.jar containing all natives and all jogamp modules
"fat-jar" is available using jogamp jogl 2.3.2
2.3.2 is not released yet but you can try one of the latest test build that include the "fat-jar":
http://jogamp.org/deployment/archive/master/gluegen_885-joal_611-jogl_1424-jocl_1073/fat/jogamp-fat.jar

miradnil wrote
When I run the project in Eclipse everything works fine. When I export the project to jar file and run it - nothing happens. I have tried to run it from console and got some error messages about missing natives.
overwrites of natives for example 32bit windows dll may overwrite the 64bit dll can occur when using:
* the eclipse "one-jar" -> export -> java runnable jar file -> * "Extract required libraries into generated JAR" deployment option.
https://jogamp.org/bugzilla/show_bug.cgi?id=1172
this has been fixed in the upcoming 2.3.2 release
you may want to re-try using the "single-slim" jars from the latest jogamp test build.
http://jogamp.org/deployment/archive/master/gluegen_885-joal_611-jogl_1424-jocl_1073/archive/jogamp-all-platforms.7z


miradnil wrote
I put all the missing dlls to jar location and it solved it but now I get a new error:

com.jogamp.opengl.GLException: Profile GL_DEFAULT is not available on WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x61598cd5]], but: []
        at com.jogamp.opengl.GLProfile.get(GLProfile.java:990)...
I can't find a working solution for that.
it is possible that you have manually mixed 32bit native dll's for use on a 64bit system,
OR if you use a 32bit jvm on a 64bit system
in such case then you will run into trouble initializing opengl. i will not speculate further because we know that when you run the project in Eclipse everything works fine, thus jogamp jogl is working.
I recommend that you try and test using one of the two above mentioned solution: use the new "fat-jar" or the new "single-slim" jars.