3

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

James Bedford
  • 28,702
  • 8
  • 57
  • 64
  • have you made sure the native librarie files(eg dll or so) are included in the library. Also try starting from the dist folder with `java -jar project.jar` and it should pick up the libaries – mikek3332002 Aug 09 '10 at 04:29
  • Yea I've tried using java -jar project.jar. This seems to work only if the library files are in the default java extensions directory for classpath, but I want to be able to include all the .jar libraries within my .jar file so they don't have to be in the classpath directory. – James Bedford Aug 09 '10 at 15:57

5 Answers5

2

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
  • 504
  • 6
  • 7
1

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
  • 2,715
  • 4
  • 29
  • 43
  • 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 Aug 07 '10 at 20:13
  • 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 Aug 08 '10 at 00:12
  • 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.path Thanks for the continued help. – James Bedford Aug 08 '10 at 02:26
  • 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 Aug 09 '10 at 17:47
0

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
  • 5,400
  • 3
  • 19
  • 35
0

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
  • 3,640
  • 3
  • 33
  • 67
0

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

Edit.: I use JNDT now, it works a lot better :)

gouessej
  • 3,640
  • 3
  • 33
  • 67