Exporting

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Exporting

JOGLbeginner

Hello everyone,

I've build a simple JOGL application to play with it. But exporting it to a runnable JAR file seems to be quite difficult. Within the Eclipse environment it works perfectly, no errors and runs smooth.

But when I export it to a runnable JAR file, it seems to crash with the following error:
C:\Users\Roland\Desktop\Game>java -jar Game2.jar
Catched FileNotFoundException: C:\Users\Roland\Desktop\Game\Game2-natives-window
s-amd64.jar (Het systeem kan het opgegeven bestand niet vinden), while TempJarCa
che.bootstrapNativeLib() of jar:file:/C:/Users/Roland/Desktop/Game/Game2-natives
-windows-amd64.jar!/ (file:/C:/Users/Roland/Desktop/Game/ + Game2-natives-window
s-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(JNILibLoad
erBase.java:442)
        at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.ja
va:59)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNIL
ibLoaderBase.java:90)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.j
ava:328)
        at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrar
y(DynamicLibraryBundle.java:390)
        at com.jogamp.common.os.Platform.loadGlueGenRTImpl(Platform.java:251)
        at com.jogamp.common.os.Platform.access$000(Platform.java:57)
        at com.jogamp.common.os.Platform$1.run(Platform.java:186)
        at com.jogamp.common.os.Platform$1.run(Platform.java:183)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:183)
        at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:246)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:196)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:186)
        at main.MainPanel.<init>(MainPanel.java:64)
        at main.Start.startApplication(Start.java:38)
        at main.Start.main(Start.java:25)

Does anyone know what is wrong and how to fix this? I can't find anything on the net.
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

Xerxes Rånby
Under library handling, choose option
2 Package required libraries into generated JAR
or 3 Copy required libraries into a sub-folder next to the generated JAR


the default option 1 Extract required libraries into generated JAR is currently not supported by the JAR layout used by JogAmp. Its questionable how to support this option because the jogamp jars contains many native files with identical names that will overwrite each other if you use this option.

Try use option 2 it will still generate a single JAR.
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

JOGLbeginner
Thank you for your quick reply!

Well it gave me a different error:
________________________
C:\Users\Roland\Desktop\Game>java -jar Game3.jar
Catched MalformedURLException: Could not open InputStream for URL 'rsrc:gluegen-
rt-natives-windows-amd64.jar', while TempJarCache.bootstrapNativeLib() of jar:rs
rc:gluegen-rt-natives-windows-amd64.jar!/ (rsrc: + gluegen-rt-natives-windows-am
d64.jar)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        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 org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: 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(JNILibLoad
erBase.java:442)
        at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.ja
va:59)
        at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNIL
ibLoaderBase.java:90)
        at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.j
ava:328)
        at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrar
y(DynamicLibraryBundle.java:390)
        at com.jogamp.common.os.Platform.loadGlueGenRTImpl(Platform.java:251)
        at com.jogamp.common.os.Platform.access$000(Platform.java:57)
        at com.jogamp.common.os.Platform$1.run(Platform.java:186)
        at com.jogamp.common.os.Platform$1.run(Platform.java:183)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.common.os.Platform.<clinit>(Platform.java:183)
        at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:82)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:246)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:196)
        at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:186)
        at main.MainPanel.<init>(MainPanel.java:64)
        at main.Start.startApplication(Start.java:38)
        at main.Start.main(Start.java:25)
        ... 5 more
________________________

Does that mean I'm missing a library element?
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

JOGLbeginner
FIXED! Thank you! I was missing some libraries indeed! Your option worked! You deserve credits for the answer!
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

Xerxes Rånby
In reply to this post by JOGLbeginner
JOGLbeginner wrote
Thank you for your quick reply!

Well it gave me a different error:
________________________
C:\Users\Roland\Desktop\Game>java -jar Game3.jar
Catched MalformedURLException: Could not open InputStream for URL 'rsrc:gluegen-
rt-natives-windows-amd64.jar', while TempJarCache.bootstrapNativeLib() of jar:rs
rc:gluegen-rt-natives-windows-amd64.jar!/ (rsrc: + gluegen-rt-natives-windows-am
d64.jar)
Exception in thread "main" java.lang.reflect.InvocationTargetException
        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 org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.path
  ...
Does that mean I'm missing a library element?
This means you need to include the gluegen-rt-natives-windows-amd64.jar (and jogl-all-natives-windows-amd64.jar) into your eclipse project before exporting in order for the native jars to be part of the exported application.
JogAmp adds support for multiple platforms by providing a set of native jars for each platform, in your case if fail to locate the windows-amd64 natives.

In your case JogAmp looks for the native jars inside the Game3.jar (its a zip file) because you have used option 2 while exporting the runnable jar using eclipse.
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

Xerxes Rånby
In reply to this post by JOGLbeginner
JOGLbeginner wrote
FIXED! Thank you! I was missing some libraries indeed! Your option worked! You deserve credits for the answer!
Happy to hear its working!
If you happen to work on an opensource game feel free to post pointers to screen-shorts and git source code repository's.

Cheers
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

JOGLbeginner
Will do! I will share code when the game is done. :)
Reply | Threaded
Open this post in threaded view
|

Re: Exporting

Sven Gothel
Administrator
In reply to this post by Xerxes Rånby
On 04/26/2013 09:50 PM, Xerxes Rånby [via jogamp] wrote:

> Under library handling, choose option
> 2 Package required libraries into generated JAR
> or 3 Copy required libraries into a sub-folder next to the generated JAR
>
>
> the default option 1 Extract required libraries into generated JAR is
> currently not supported by the JAR layout used by JogAmp. Its questionable how
> to support this option because the jogamp jars contains many native files with
> identical names that will overwrite each other if you use this option.
>
> Try use option 2 it will still generate a single JAR.
Yup, deja-vu - please read:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=522#c7>

Looks like <https://jogamp.org/bugzilla/show_bug.cgi?id=542#c1>
hasn't been completed fully yet in regards to exporting.

Reopened:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=542#c7>

~Sven



signature.asc (911 bytes) Download Attachment