views:

140

answers:

5

Hi,

I've written an application the builds fine on my machine but when I move it to another machine the dependent JOGL libraries cannot be found.

Is it possible to create a build that sets up all the required JOGL files so that you can distribute your Java application with the necessary JOGL libraries?

If someone could explain this in NetBeans that'd be appreciated too.

Thanks,

James

+1  A: 

This usually happens because the libraries are located on your machine somewhere, which is the way that most tutorials recommend that you install JOGL. The key is to add the JOGL libraries inside your project, and point the project to use those rather than the libraries on your machine. You should then be able to package the application.

Note that because the JOGL bindings are platform-dependent, it means (for example) that if you wrote this on a Mac and try to deploy to Windows, it won't work because the native calls aren't available.

Feanor
Thanks for your reply. Do you know how I can add the libraries? I've tried everything in Netbeans but after removing the libraries from the classpath I can't find a way to successfully compile the project with the jars inside the project!
James Bedford
Add them to the classpath using the path to where they are in the project. For example, I added the JOGL /lib folder to my project and then added the resources in that folder to the classpath.
Feanor
I've tried setting the classpath to point to the folder that holds the .jar files (like you're lib directory), as well as adding the .jar files under the "Libraries" tab of the project properties window (which enables it to compile, but I'm still getting the following runtime exception:Exception in thread "main" java.lang.UnsatisfiedLinkError: no gluegen-rt in java.library.pathThanks for the continued help.
James Bedford
I'll try to get a working example for you - I'm having some problems opening my project at the moment, but I did this exact thing not long ago.
Feanor
Thanks very much Feanor - much appreciated!
James Bedford
A: 

We usually distribute our JOGL based applications using Jnlp. This allows the automatic platform detection from the JNLP Launcher to kick in as well as the use of recent versions of Jogl Libraries. If you would like to see how to craft a proper JNLP look at the samples on this page for NASA WorldWind.

whatnick
A: 

You can use Java Webstart to deploy an application using JOGL, it is explained here: http://jogamp.org/jogl/doc/deployment/JOGL-DEPLOYMENT.html

gouessej
A: 

Look at my own JNLP file if you want: http://tuer.sourceforge.net/tuer.jnlp

gouessej
A: 

I wrote a tutorial about how to create redistributable JOGL apps for multiple platforms. The tutorial uses Eclipse instead of NetBeans, but the principles should be the same. You can use this system to build JOGL apps that are completely self-contained, so they don't even require the user to have Java installed.

The tutorial is on my blog at http://wadeawalker.wordpress.com/2010/10/24/tutorial-creating-native-binary-executables-for-multi-platform-java-apps-with-opengl-and-eclipse-rcp/.

Wade Walker