I am experimenting with the idea of writing Processing apps with Jython on MacOSX Snow Leopard using Eclipse/PyDev. Simple sketches are working pretty well, but when I attempt to use the OpenGL APIs the app crashes and throws this error:
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
Note that this is a runtime error, not a build error. It looks like the JVM can't find the jogl libs, though I have added them to the External Libraries in the project settings. In fact I've added all of the following:
- core.jar
- jogl.jar
- gluegen-rt.jar
- opengl.jar
- libgluegen-rt.jnilib
- libjogl_awt.jnilib
- libjogl_cg.jnilib
- libjogl.jnilib
Inspecting the Python path reveals that all of these files are in fact on the Python path but when I look at the Java path using:
System.getProperty("java.library.path")
» » I see only this » »
/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Clearly something is wrong with the linking of these libs. What could it be?
UPDATE: I found the issue to be that the paths to the native libraries for the .jar files were not being added to the Java path. PyDev does not appear to accomodate setting the path to the native library of a linked .jar file like the standard Eclipse Java project settings do. So as a fix I was able to add the directory of the native libs throug a VM argument in the Run Configurations.
UPDATE 2: I've written an article on the env configuration: http://bit.ly/yHjIw9