Can't use OpenGL in eclips.

edited March 2014 in Questions about Tools

** I am getting following error in eclips. I have successfully run same code in processing IDE 2.1. Now i have exported it in eclips for creating jar file. But its not running here.**

java.lang.NoClassDefFoundError: javax/media/opengl/GLException
    at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:1697)
    at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:529)
    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)
    at processing.core.PApplet.size(PApplet.java:1692)
    at processing.core.PApplet.size(PApplet.java:1663)
    at accMB.setup(accMB.java:51)
    at processing.core.PApplet.handleDraw(PApplet.java:2281)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
    at processing.core.PApplet.run(PApplet.java:2177)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLException
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 15 more
Exception in thread "Animation Thread" java.lang.RuntimeException: javax/media/opengl/GLException
    at processing.core.PApplet.makeGraphics(PApplet.java:1865)
    at processing.core.PApplet.size(PApplet.java:1692)
    at processing.core.PApplet.size(PApplet.java:1663)
    at accMB.setup(accMB.java:51)
    at processing.core.PApplet.handleDraw(PApplet.java:2281)
    at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:243)
    at processing.core.PApplet.run(PApplet.java:2177)
    at java.lang.Thread.run(Unknown Source)

Answers

  • Answer ✓

    You need to add all the OpenGL files to the Eclipse project build configuration e.g.

    eclipse-opengl

Sign In or Register to comment.