Bug 1259 : OPENGL fails with 'no jogl in java.library.path'
Last modified: 2009-10-21 11:00




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
Andreas F
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2009-06-01 17:11
I have both 1.0.3 and 1.0.4 running on my system (OS X 10.5.7) and while
all included OPENGL examples in 1.0.3 work fine, they all fail in 1.0.4.
E.g. the Yellowtail example stops
at the line

size(1024, 768, OPENGL);

with the error:

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: no
jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1753)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:993)
at
com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:189)
at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:49)
at
com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeLibLoader.java:80)
at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:103)
at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109)
at
com.sun.opengl.impl.macosx.MacOSXGLDrawableFactory.<clinit>(MacOSXGLDrawableFactory.java:53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:108)
at processing.opengl.PGraphicsOpenGL.allocate(PGraphicsOpenGL.java:171)
at processing.core.PGraphics3D.setSize(PGraphics3D.java:316)
at processing.core.PApplet.makeGraphics(PApplet.java:1148)
at processing.core.PApplet.size(PApplet.java:982)
at processing.core.PApplet.size(PApplet.java:942)
at Yellowtail.setup(Yellowtail.java:47)
at processing.core.PApplet.handleDraw(PApplet.java:1383)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Thread.java:613)
Additional Comment #1 From fry 2009-06-02 04:15
I'm not seeing any problems like this. Is there perhaps a conflicting
version of JOGL somewhere on your machine?
Additional Comment #2 From fry 2009-06-02 12:36
*** Bug 1262 has been marked as a duplicate of this bug. ***
Additional Comment #3 From fry 2009-06-02 12:38
Also, is it possible that you have Java 1.6 set as the default version of
Java on your machine? Does 1.0.3 still work?
Additional Comment #4 From Andreas F 2009-06-02 13:31
I believe, I have only the standard Java installation from Apple which say:
java version "1.5.0_16". In addition, I had sometime ago installed JOGL
libraries manually.

Some more info (I should have checked this earlier):

- I must have recently broken my JOGL native libraries, so in effect the
error message from 1.0.4 was correct in the sense there was no working a
native JOGL in the path
- what I guess is a feature but tricked me is that all the OpenGL examples
in 1.0.3 still worked, probably falling back on something else
- now I manually reinstalled the JOGL native libraries and jogl.jar - and
the examples work fine in 1.0.4.

However, there are still subtle differences that I don't understand. These
are probably not important but while we are at it: E.g. when I run the
included OpenGL example 'SpaceJunk' I get the following:
- unchanged examples in 1.0.4: fast graphics, boxes are dark blueish
- unchanged example in 1.0.3: fast graphics, boxes are grey-pink
- example with `size(1024, 768, P3D)', 1.0.4: slower graphics, boxes are
grey-pink
- example with `size(1024, 768, P3D)', 1.0.3: slower graphics, boxes are
grey-pink

So, I am not sure that 1.0.3 actually uses the native libraries at all but
it does something faster than P3D nevertheless.

If you need more info, let me know.
Additional Comment #5 From fry 2009-06-02 14:12
You shouldn't ever (need to) install JOGL, because it's included with
Processing. It's more likely that installing another version of JOGL other
than what's included would cause this problem, for instance. So make sure
there aren't conflicting versions of jogl.jar and friends anywhere in your
CLASSPATH. Just do a full search of your machine to make sure there isn't a
jogl.jar version out there somewhere. A similar problem may happen if it's
in your sketchbook as well.
Additional Comment #6 From Andreas F 2009-06-02 14:52

Ah, I see. Thanks for the information. Then however, I believe there is
still something
wrong. With the JOGL libraries still manually installed in
/System/Library/Java/Extensions
I get for example:

sudo find / -name "jogl.jar" -print
/Applications/MATLAB_R2009a.app/java/jarext/jogl.jar
/Applications/Processing.app/Contents/Resources/Java/libraries/opengl/library/jogl.jar
/Applications/Processing104.app/Contents/Resources/Java/libraries/opengl/library/jogl.jar
/System/Library/Java/Extensions/jogl.jar

sudo find / -name "libjogl.jnilib" -print
/Applications/MATLAB_R2009a.app/bin/maci/libjogl.jnilib
/Applications/Processing.app/Contents/Resources/Java/libraries/opengl/library/libjogl.jnilib
/Applications/Processing104.app/Contents/Resources/Java/libraries/opengl/library/libjogl.jnilib
/System/Library/Java/Extensions/libjogl.jnilib

With this setup the SpaceJunk example runs fine in 1.0.3 and 1.0.4.

However, then in /System/Library/Java/Extensions I do

rm jogl.jar libjogl*

and try again: the example works still as before in 1.0.3 while 1.0.4 shows
the error message
as reported in the original bug report.

And I don't think it's a problem with the system CLASSPATH:

DEFAULT_CLASSPATH=$HOME/Library/Java:$NEXT_ROOT/Library/Java:$NEXT_ROOT/System/Library/Java:$NEXT_ROOT/Network/Library/Java:$NEXT_ROOT/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:$NEXT_ROOT/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar

Finally, I did try to remove Processing 1.0.3 but also then 1.0.4 shows the
same error.
Additional Comment #7 From fry 2009-06-03 13:42
Hm, still trying to figure out what could have changed, since I can't get
the problem to replicate. Perhaps try removing any user CLASSPATH or
LD_LIBRARY_PATH stuff from your profile/bashrc/login files, reboot and see
what happens?
Additional Comment #8 From Andreas F 2009-06-03 16:48
I have checked that neither CLASSPATH nor LD_LIBRARY_PATH get set in any
profile, rebooted and get the same result.

On Friday I can test this on a different Mac which has a very similar
installation except that I did not yet install the latest Apple security
update there.
Additional Comment #9 From Andreas F 2009-06-05 12:47
I found the problem and you've been right (of course): it was a conflicting
library in the sketchbook which I'd forgotten about:

- I could not recreate the problem on a second Mac which has basically an
identical installation
- I then tried to find again extra JOGL libs on the machine with the
problem. After a long time (since I am new to Java) I added
System.out.println("Library Path " + System.getProperty("java.library.path"));
to the OpenGL sketches causing the problem and found that the first folder
pointed to the
volTron library (http://dm.ncl.ac.uk/joescully/voltronlib/).
- removing that library solved the problem (I will contact the author of
the lib later today)

Thanks for all the help and sorry for not seeing this earlier myself!
Additional Comment #10 From fry 2009-06-07 15:59
k, closing bug.
Additional Comment #11 From fry 2009-06-09 08:15
*** Bug 1269 has been marked as a duplicate of this bug. ***
Additional Comment #12 From iching 2009-06-09 09:19
Also 1.0.5. is having problems with the jogl.
I found the fullscreen api to be the problem.
Removed it from the libraries directory and OPENGL works again.
I'll try to contact the developer of the fullscreen library to report this
problem.
Additional Comment #13 From fry 2009-08-31 06:45
*** Bug 1314 has been marked as a duplicate of this bug. ***
Additional Comment #14 From fry 2009-10-21 11:00
*** Bug 745 has been marked as a duplicate of this bug. ***