Login  Register

Packaging JOGL projects to be cross-platform?

Posted by KevinWorkman on Jan 21, 2014; 3:03am
URL: https://forum.jogamp.org/Packaging-JOGL-projects-to-be-cross-platform-tp4031261.html

Hey all,

I'm looking to find a way to package up Processing projects (which use JOGL and gluegen) as a single executable jar. Processing only gives you the natives for the current system you're on (in my case, gluegen-rt-natives-windows-amd64.jar and jogl-all-natives-windows-amd64.jar), but I want to be able to send my projects to people on mac or linux machines as well. To that end, I downloaded the natives as described on this page, and I copied all of the native jars into another directory for easy access.

To create a single jar, I've been trying to use JarSplice: for those not familiar, JarSplice simply takes multiple jars, extracts the files from each, and adds those files to a new jar to create a "fat jar" that contains everything in one file. I've tried simply adding the jars exported by Processing as well as the jars I copied into the directory I just mentioned, hoping that would cause the natives for every system to be included.

However, when I run JarSplice, I get this error: duplicate entry: libgluegen-rt.so. A little more investigation shows why this happens: all of the native JOGL and gluegen jars for a particular system contain files with the same name. For example, the native jars for linux-amd64 contain files with the same name as linux-armv6, etc.

So I know why this is happening, but is there a better approach to creating a cross-platform application that uses JOGL?