Problems getting JOGL demos working in Eclipse

Hi Guys,

I’ve downloaded all the jar/zip packages from the jogl homepage, then installed eclipse, copied all jars to the path /usr/jogl.

This path added to CLASSPATH, LD_LIBRARY_PATH

After googling “eclipse java” various sites suggested copying the jar files into these locations, which I have done.
jogl.jar -> /usr/java/j2sdk1.4.2_08/jre/lib/, PROJECT_HOME/lib
jogl-natives-linux.jar -> /usr/java/j2sdk1.4.2_08/jre/lib/ext/, PROJECT_HOME/lib

I created a new project inside my default workspace in Eclipse with build path classpath links to all the jar files. I copied the demo Gear.java into my project directory. These settings are correct as Eclipse successfully compiles Gear.java.

However, Eclipse does not run the Gear demo and displays this error

“Exception in thread “main” java.lang.UnsatisfiedLinkError: no jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1517)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
…”

If i simply run “java bin/Gears” from the shell the app runs successfully.

A tutorial PDF I found suggested using this code to test the jogl library

              //Load the libraries
              System.loadLibrary("jogl");
              System.out.println("Hello World! (The native libraries are installed.)"); 
              //Test for the presence of the JAR
              GLCapabilities glCaps = new GLCapabilities();
              System.out.println(glCaps.toString());
              System.out.println("Hello JOGL! (The jar appears to be available.)");

This ran in Eclipse with no Exceptions.

My run configuration for the test app and Gears was exactly the same (except of course for the main() class).

The run configuration has the following settings
VM Arguments: -Djava.library.path=.:/usr/jogl
JRE: j2sdk_1.4.2_08
Classpath entries: links to jogl.jar,jogl-natives-linux.jar and /usr/jogl were added to bootstrap entries.
Environment: CLASSPATH and LD_LIBRARY_PATH were included from global environment

I feel like I’ve tried everything I can to get this working, but I am not not sure what to do. The confusing thing is that I can get it working through the shell and the class loader test code works fine. The referring PDF said if the loader test code works, then the demos should work.

What should I try?

Thanks in advance

-CVertex

Unjar the jogl-natives-(platform).jar and put the resulting .so’s into your /usr/jogl directory. Based on your command line arguments to the VM that should fix it.

Thanks for your suggestion Ken,

I tried that already, but no luck :frowning:

Here are the contents of /usr/jogl

jogl-demos-data.jar jogl.jar libjogl.so
jogl-demos.jar jogl-natives-linux.jar* META-INF/
jogl-demos-util.jar libjogl_cg.so TEMP/

In this case I think you need to get jogl.jar off the boot class path and on to the normal (application) class path. I don’t know Eclipse but assume there must be some way to do this.

That worked. Great!

I moved all the jar files in the classpath pane from Bootstrap to user-defined and it ran in Eclipse.

Thanks Ken!