Build in eclipse using OpenGL fails

edited February 2014 in Questions about Tools

I successfully built a Processing Applet in Eclipse but when I try with OpenGL it fails to find some library.

I just pasted in all the libraries on the premise that one of them would contain the OpenGL library, but obviously not. What libraries must be added, and where are they?

Here are all the libraries that are included

core.jar
gluegen-rt-natives-linux-i586.jar
gluegen-rt-natives-windows-amd64.jar
gluegen-rt-natives-windows-i586.jar
gluegen-rt.jar
jogl-all-natives-linux-i586.jar
jogl-all-natives-windows-amd64.jar
jogl-all-natives-windows-i586.jar
jogl-all.jar

Here is the exception generated:

java.lang.NoClassDefFoundError: javax/media/opengl/GLException
    at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:1716)
    at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:518)
    at processing.opengl.PGraphics3D.<init>(PGraphics3D.java:37)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at processing.core.PApplet.makeGraphics(PApplet.java:1840)
Tagged:

Answers

  • Answer ✓

    You need to add the libraries to the build path. In Eclipse right-click on the project folder and select Build Path > Config Build Path from the popup menu. Select the Libraries tab then click Add External JARS... navigate to the folder and add the ALL the opengl jars

Sign In or Register to comment.