PDA

View Full Version : How to set up JOGL?



marce
07-10-2009, 03:47 AM
I have downloaded jogl-1.1.0-b04-bin-windows.zip from https://games-binaries.dev.java.net/build/index.html. (https://games-binaries.dev.java.net/build/index.html)

I also have set the JOGL.jar in my CLASSPATH. But I allways get UnsatisfiedLinkError exception when I try to run my apps. Where should I put all the other files?

marce
07-10-2009, 01:16 PM
I would really appreciate if somebody could tell how to install JOGL manually (without using the NetBeans extension which is using the packages javax.media.opengl and com.sun.opengl and NOT the net.java.games.jogl that is the package I want to use).

I have edited my PATH variable and added the path to jogl.jar.

But I allways get the UnsatisfiedLinkError when I try to run my application. I can compile it, but not run it.

Why?


java.lang.UnsatisfiedLinkError: net.java.games.jogl.impl.JAWTFactory.JAWT_GetAWT0( Ljava/nio/Buffer;)Z
at net.java.games.jogl.impl.JAWTFactory.JAWT_GetAWT0( Native Method)
at net.java.games.jogl.impl.JAWTFactory.JAWT_GetAWT(J AWTFactory.java:26)
at net.java.games.jogl.impl.NativeLibLoader$1.run(Nat iveLibLoader.java:66)
at java.security.AccessController.doPrivileged(Native Method)
at net.java.games.jogl.impl.NativeLibLoader.<clinit>(NativeLibLoader.java:46)
at net.java.games.jogl.impl.GLContext.<clinit>(GLContext.java:51)
at net.java.games.jogl.impl.windows.WindowsGLContextF actory.createGLContext(WindowsGLContextFactory.jav a:82)
at net.java.games.jogl.GLCanvas.<init>(GLCanvas.java:69)
at net.java.games.jogl.GLDrawableFactory.createGLCanv as(GLDrawableFactory.java:150)
at net.java.games.jogl.GLDrawableFactory.createGLCanv as(GLDrawableFactory.java:118)
at net.java.games.jogl.GLDrawableFactory.createGLCanv as(GLDrawableFactory.java:85)
at org.Exercise.SimpleJOGL.<init>(SimpleJOGL.java:45)
at org.Exercise.SimpleJOGL.main(SimpleJOGL.java:21)

ZbuffeR
07-10-2009, 02:00 PM
Jogl needs both the jogl.jar and the native code jar.
http://www.cs.gmu.edu/~jchen/graphics/jogl/notes/joglSetup.html
Add the native lib to your classpath it should work.

marce
07-10-2009, 03:00 PM
I have done that and I have also followed many other installation guides, but I still get the UnsatisfiedLinkError:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path

How do I add the jogl to java.library.path?

Sometimes it also complains about this:

C:\Program Files (x86)\Java\jdk1.6.0_12\jre\bin\jogl.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform Is there any native libs for AMD 64-bit platform?

I have now done this:

1) Added these line to my CLASSPATH:
C:\Program Files (x86)\Java\jdk1.6.0_12\jre\lib\ext\jogl.jar;
C:\Program Files (x86)\Java\jdk1.6.0_12\JOGL\gluegen-rt.jar;
C:\Program Files (x86)\Java\jre6\bin\jogl-natives-windows-i586.jar

2)I have also added some JOGL related DLL files in
C:\Program Files (x86)\Java\jdk1.6.0_12\bin\

I can compile all my applications, but it fails when I try to run them. Then I get UnsatisfiedLinkError.

So what can the problem be???

Any other suggestions?

ZbuffeR
07-10-2009, 05:05 PM
You definitively have a problem with the native libraries.
The java libraries however are fine, that is why you are able to compile it.
But at runtime, native is mandatory to talk to opengl.

BTW, searching with your error message returned this interesting info :
http://forum.worldwindcentral.com/showthread.php?t=13178

And you really should install an amd64 bits native jogl lib that match your JVM architecture. Or install a 32 bit JVM.

pudman
07-11-2009, 03:10 PM
How do I add the jogl to java.library.path?


java -Djava.library.path=<path to jogl.dll>

I believe the default location it looks for jogl.dll is in the same directory as jogl.jar.