Is merging the Jogl classes into one Jar safe?

In case you don’t use Webstart: is it safe to merge all of Jogl’s class files of the different platform’s zip files into on Jar and using this single Jar file with your application?
Or put it in another way: is it safe to assume that just the net/java/games/jogl/impl/ folders are different for the different platforms, while the other classes are identical?

I used to do this and it worked for Win32 and Linux (hadn’t tested it with Mac and Solaris), but would like to see if this is officially OK.

Another question: is there an easy way for the non-Win32 platforms to have the native lib laying next to the Jogl jar in order to make it work? With Win32 this is possible, but I’m not sure about the other platforms. For example your app is on CD/media like this:
° DoubleclickableApp.jar (its Manifest references jogl.jar)
° jogl.jar (containing the classes for all platforms)
° jogl.dll
° libjogl.so
° libjogl.jnilib

(Well, listing it this way shows that the lib for Solaris and Linux have the same name, so for these platforms it won’t work anyway.)

I’d be very happy to see Jogl to be included in a J2SE one day, so I could just use platform independent Java bytcode JARs…

I guess you may try to programmatically set java.library.path system property to point to folder of jar file before any use of JOGL, but this is just a guess.

Yuri

It is safe to merge the various platforms’ jogl.jars into one. This is how the release builds are created; these are available from the Documents & files page off of the JOGL web page. Take a look at the “dist” target in JOGL’s make/build.xml. However, the hope would be that you could just use the release build rather than having to do this yourself.

To reference the native libraries, I would recommend putting them into subdirectories like solsparc/, macosx/, linux/, windows/ and writing wrapper scripts like “run.bat” / “run.sh” to determine the platform and specify -Djava.library.path appropriately. Either that or consider shipping a JNLP file as the launch mechanism with appropriate file:// URLs. I think there are new features in the 1.5 version of Java Web Start that assist in deploying desktop applications (i.e., on a CD) using JNLP.

Thanks for the answers.
A few small bat or sh starters is a good idea.
I’ve tried the jogl-1.0beta-dist.zip on the Jogl web site and it basically contains everything we need in one place. Just (currently?) the Zip’s jogl-solsparc jar file and folder is empty, so I use the lib of jogl-1.0beta-bin-solaris.zip …

I’m looking forward to Java 1.5 with the new Webstart features. Sounds again very good: CD/media based Webstart.
It’s all going in the right direction. Really good.

[quote]I’ve tried the jogl-1.0beta-dist.zip on the Jogl web site and it basically contains everything we need in one place. Just (currently?) the Zip’s jogl-solsparc jar file and folder is empty, so I use the lib of jogl-1.0beta-bin-solaris.zip …
[/quote]
This is confusing, but please look to the “Release Builds” section under the JOGL web page’s “Documents & files” section for release builds of JOGL. The nightly builds in the games-binaries project are not guaranteed to be stable.

Many thanks for that hint. I’ll use the release versions from now on.