jogl tries to load native libraries via ClassLoader.getResource() from the packaged jars in the lib subfolder of the jar created by onejar,
seems that the "onejar:"-protocol is not available at this position
Exception in thread "main" java.lang.ExceptionInInitializerError
at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:1141)
at testprogram.Main.<clinit>(Main.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.simontuffs.onejar.Boot.run(Boot.java:306)
at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: java.lang.ClassCastException: sun.misc.Launcher$AppClassLoader cannot
be cast to com.simontuffs.onejar.JarClassLoader
at com.simontuffs.onejar.JarClassLoader.getByteStream(JarClassLoader.jav
a:753)
at com.simontuffs.onejar.Handler$1.getInputStream(Handler.java:50)
at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
at com.jogamp.common.util.JarUtil.getJarFile(JarUtil.java:176)
at com.jogamp.common.os.Platform$3.run(Platform.java:311)
at java.security.AccessController.doPrivileged(Native Method)
at com.jogamp.common.os.Platform.loadGlueGenRTImpl(Platform.java:302)
at com.jogamp.common.os.Platform.<clinit>(Platform.java:211)
... 8 more
I think this is a fundamental limitation of the sun native libarary loader: it doesn't respect the URL resolvers that one-jar would like to use. The most direct solution to this is to expand your library into a temporary directory, then the native loader will be able to find it.
It might be possible to relaunch the JVM with a modified bootstrap classloader that would allow the native loader to look inside the one-jar: I have not experimented with this but am interested in the approach. I will keep this in mind when I resume work on the tool.