Login  Register

Packaging JOGL into single generated JAR in Eclipse

Posted by iliasr on Sep 16, 2013; 11:11am
URL: https://forum.jogamp.org/Packaging-JOGL-into-single-generated-JAR-in-Eclipse-tp4030045.html

Hello all,

I am using JOGL in a project of mine, and I am trying to build a JAR file through Eclipse that will contain all native jars so that it can be run in multiple platforms. I have followed the instructions posted here:

https://jogamp.org/bugzilla/show_bug.cgi?id=522#c7

Sorry for digging out an old comment, but this is exactly what I believe should work for me. I am following the exact procedure, but I am getting the following exceptions:

Catched URISyntaxException: Expected scheme-specific part at index 5: rsrc:, while TempJarCache.bootstrapNativeLib() of null (null + gluegen-rt-natives-linux-i586.jar)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: PROJECT_DIR/dist/libgluegen-rt.so
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1649)
        at java.lang.Runtime.load0(Runtime.java:787)
        at java.lang.System.load(System.java:1022)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:468)
        at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:94)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:332)
        at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:390)
        at com.jogamp.common.os.Platform$1.run(Platform.java:210)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:173)
        at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
        at ch.ethz.sg.cuttlefish.gui.visualization.NetworkRenderer.getCaps(NetworkRenderer.java:67)
        at ch.ethz.sg.cuttlefish.gui.visualization.NetworkRenderer.<init>(NetworkRenderer.java:96)
        at ch.ethz.sg.cuttlefish.gui.NetworkPanel.initialize(NetworkPanel.java:156)
        at ch.ethz.sg.cuttlefish.gui.NetworkPanel.<init>(NetworkPanel.java:100)
        at ch.ethz.sg.cuttlefish.gui.Cuttlefish.getNetworkPanel(Cuttlefish.java:89)
        at ch.ethz.sg.cuttlefish.gui.Cuttlefish.getMainMenu(Cuttlefish.java:81)
        at ch.ethz.sg.cuttlefish.gui.Cuttlefish.initialize(Cuttlefish.java:54)
        at ch.ethz.sg.cuttlefish.gui.Cuttlefish.<init>(Cuttlefish.java:42)
        at ch.ethz.sg.cuttlefish.Cuttlefish.startGui(Cuttlefish.java:140)
        at ch.ethz.sg.cuttlefish.Cuttlefish.main(Cuttlefish.java:111)
        ... 5 more

Please note that the UnsatisfiedLinkError pertains to the directory PROJECT_DIR/dist/ , which is the directory I'm using as the JAR exporting destination path (following Test-2 of the aforementioned guidelines).

I can't seem to be able to resolve this, and I was wondering if you maybe had some pointers as to how to go about...

Thanks for your time, and sorry for the long message!

Cheers,
Ilias