0

I have to extract a runnable jar file from an Eclipse project. I know that choosing Package required libraries into generated JAR makes the jar file slower than choosing Extract required libraries into generated JAR, but the problem is that if I extract the libraries, rather than package them, the application doesn't start because of the following error:

Catched FileNotFoundException: C:\Users\rober\Desktop\palbo-natives-windows-amd64.jar (The system cannot find the file specified), while TempJarCache.bootstrapNativeLib() of jar:file:/C:/Users/rober/Desktop/palbo-natives-windows-amd64.jar!/ (file:/C:/Users/rober/Desktop/ + palbo-natives-windows-amd64.jar)
Exception in thread "main" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:454)
    at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:59)
    at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:90)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:328)
    at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:390)
    at com.jogamp.common.os.Platform$2.run(Platform.java:249)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.jogamp.common.os.Platform.loadGlueGenRTImpl(Platform.java:231)
    at com.jogamp.common.os.Platform.<clinit>(Platform.java:183)
    at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:99)
    at org.jzy3d.global.Settings.<init>(Settings.java:12)
    at org.jzy3d.global.Settings.getInstance(Settings.java:21)
    at org.jzy3d.chart.Chart.<init>(Chart.java:59)

Of course, all the required libraries have been added to the Eclipse project and thus the application perfectly works if launched in Eclipse.

Is there a way to avoid this issue? In other words, is there a way to make my jar finding all the required libraries even if I choose the option Extract required libraries into generated JAR or Copy required libraries into a sub-folder next to the generated JAR?

Additional info:

even if I choose the option Package required libraries into generated JAR, I need to have some .dll files (e.g. gluegen-rt.dll, jogl.dll, jogl_awt.dll, jogl_cg.dll) in the same folder of the runnable jar files in order to make it opens correctly. Moreover, the application takes forever to be initialized.

Summary:

Extract required libraries into generated JAR or Copy required libraries into a sub-folder next to the generated JAR: the application cannot be opened because of the above posted Exception.

Package required libraries into generated JAR: noteworthy performance issue.

Roberto
  • 243
  • 1
  • 5
  • 15
  • Check this post http://stackoverflow.com/questions/957700/how-to-set-the-java-library-path-from-eclipse/958074#958074. Might solve your problem. – rootExplorr Jul 06 '16 at 16:41
  • Unfortunately it doesn't or, at least, I'm not able to implement it correctly. My problem is how to make the jar opening also if I **Extract** the required libraries or how to boost application performance if I choose **Package**. – Roberto Jul 07 '16 at 13:21

0 Answers0