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 |
Administrator
|
Hi
If you really want your application to work on multiple platforms, Java Web Start will be safer than a fat JAR. Which version of JOGL do you use?
Julien Gouesse | Personal blog | Website
|
Hello,
thanks for replying! I'm using version 2.0.2. I'm not very familiar with Java Web Start as to how to build my application though, that's why I preferred to go with the traditional JAR method. I assume you are referring to the following post: http://jogamp.org/jogl/doc/userguide/index.html#automatednativelibraryloading Still, some pointers would be appreciated :) Thanks! |
Administrator
|
Using a single JAR may have a very few advantages in particular cases, Java Web Start has some limitations but don't use a single JAR just to avoid using Java Web Start.
A JAR can be opened by the default archiver under Windows and Linux instead of being run. Moreover, some versions of web browsers (Firefox?) puts JARs into ZIP files but keep the same name which prevents them to work when double-clicking... You can look at this and this. You can sign your JARs and generate your JNLP files in any IDE and/or with Ant too.
Julien Gouesse | Personal blog | Website
|
Hello again,
thank you for the help on Web Start. However, unfortunately for the needs my project, it must be so that a single jar is created -- does anybody have any pointers in this direction? |
Administrator
|
The exception above is probably caused by a regression on JOGL, maybe it has something to do with the use of URIs.
You can look at the existing posts in this forum, some people succeeded in doing it but this is not a viable approach except when used in conjunction with Java Web Start (to reduce the number of OSCP checks for example), it's too much weak, it's so easy to break. You can merge JARs by using an Ant script in Eclipse, I explained how to do that in another post.
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |