Mac OSX 10.8.3 - OpenGL NoClassDefFoundError: javax/media/opengl/GLException
in
Integration and Hardware
•
6 months ago
Hi. Using Processing ( 2.0x) on a 2012 Mac Mini running OSX 10.8.3, I had been encountering a funky error whenever I tried to run sketches with the following line:
- size(width, height, P3D)
It did not matter what the width and height were, only that the renderer was set to P3D or OPENGL (the same). It always produced an error:
java.lang.NoClassDefFoundError: javax/media/opengl/GLException
at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:471)...
2D sketches worked just fine!
...I tried a bunch of things, but the solution was surprisingly simple.
As it turned out, the OpenGL .jar files from Resources/Java/core/library just needed to be copied to the folder /System/Library/Java/Extensions. In my case, this worked after copying the following:
- jogl-all.jar
- jogl-all-natives-macosx-universal.jar
- gluegen-rt.jar
- gluegen-rt-natives-macosx-universal.jar
If you want to develop for other platforms, you should maybe also copy the relevant files over as well. This solution also ended up giving me a handy dependencies target for making Processing projects in Eclipse or IntelliJ IDEs, but remember to also copy core.jar if you're using these IDEs.
Hopefully this helps someone else with the same problems...
1