Login  Register

Re: Properly Exporting JOGL

Posted by Xerxes Rånby on Nov 07, 2013; 8:15am
URL: https://forum.jogamp.org/Properly-Exporting-JOGL-tp4030517p4030518.html

When you use java -jar to launch your application you should add the jogamp jar
names to the Class-Path: entry of the
META-INF/MANIFEST.MF file, that is found inside your MinimalEngineDemo.jar

example: you want your
MinimalEngineDemo.jar META-INF/MANIFEST.MF
to at least contain
Class-Path: gluegen-rt.jar jogl-all.jar

META-INF/MANIFEST.MF Class-Path: configuration for -jar use is explained in:
http://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html
http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html


Your application folder will then look like:
MinimalEngineDemo.jar
gluegen-rt.jar
jogl-all.jar
gluegen-rt-natives-linux-amd64.jar
jogl-all-natives-linux-amd64.jar
... add one copy of natives for all platforms you want to support.

You can then start your application using the most simple command line:
java -jar MinimalEngineDemo.jar

JogAmp is designed to locate the native library jars that contain the .dll
and .so files next
to the used gluegen-rt.jar and jogl-all.jar automatically thats why you do
not need to add the
gluegen-rt-natives-*.jar and jogl-all-natives-*.jar to the Class-Path:
inside the META-INF/MANIFEST.MF
This is explained in:
http://jogamp.org/jogl/doc/deployment/JOGL-DEPLOYMENT.html#NativeJARFiles
https://jogamp.org/wiki/index.php/JogAmp_JAR_File_Handling

Cheers
Xerxes


2013/11/7 TownEater [via jogamp] <ml-node+s762907n4030517h90@n3.nabble.com>

> Hi, I'm still rather new to using jogl and openGL in general, but I've
> gotten it to work and run a basic game demo inside eclipse. I can also get
> the game to export and run, but in order to do that, I have to put a folder
> named "lib" next to the runnable jar file, then create a .bat file to run
> the jar like this:
>
> java -Djava.library.path=lib -jar MinimalEngineDemo.jar
>
> I'm almost certain this is not the proper way to do this, and I'd like to
> be able to just contain everything(refferenced .jar files like
> gluegen-rt.jar, and .dll files like gluegen-rt.dll) in the runnable jar
> file. How exactly would I have to go about this? I've scoured forums and
> tutorials and documentation but they all say different things and none of
> them seem to work.
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
> http://forum.jogamp.org/Properly-Exporting-JOGL-tp4030517.html
>  To start a new topic under jogl, email
> ml-node+s762907n782158h61@n3.nabble.com
> To unsubscribe from jogamp, click here<http://forum.jogamp.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=762907&code=eGVyeGVzQGd1ZGlubmEuY29tfDc2MjkwN3wtNTE5NjUwMzEw>
> .
> NAML<http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>