Cannot run P3D sketches when running Processing from Eclipse

Hello all. I am using Processing within Eclipse and while I can get sketches using the P2D renderer to work, P3D throws this error.

Exception in thread "Animation Thread" java.lang.NoSuchMethodError: javax.media.opengl.GLDrawableFactory.initSingleton()V
    at javax.media.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1573)
    at javax.media.opengl.GLProfile.access$100(GLProfile.java:76)
    at javax.media.opengl.GLProfile$1.run(GLProfile.java:155)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.media.opengl.GLProfile.initSingleton(GLProfile.java:123)
    at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:2070)
    at javax.media.opengl.GLProfile.get(GLProfile.java:906)
    at javax.media.opengl.GLProfile.getGL2ES1(GLProfile.java:797)
    at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
    at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6244)
    at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1625)
    at processing.core.PApplet.run(PApplet.java:2177)
    at java.lang.Thread.run(Unknown Source)

I am trying to run the simple demo code from the peasycam library, just to test it out. Here is the code. I have also configured the build path in Eclipse to include core, jogl-all, gluegen-rt, and related Windows natives. I am running Java 7 and am using Processing v2.1.1 (win64 version), and have Windows 7 OS.

import processing.core.*;
import peasy.*;

public class P3DTest extends PApplet {

    public static PeasyCam cam;

    public static void main(String args[]) {
        PApplet.main(new String[] { "--present", "model.P3DTest" });
    }

    public void setup() {
        size(200, 200, P3D);
        cam = new PeasyCam(this, 100);
        cam.setMinimumDistance(50);
        cam.setMaximumDistance(500);
    }

    public void draw() {
        cam.rotateX(-.5);
        cam.rotateY(-.5);
        background(0);
        fill(255, 0, 0);
        box(30);
        pushMatrix();
        translate(0, 0, 20);
        fill(0, 0, 255);
        box(5);
        popMatrix();
    }

}

Any help would be very much appreciated!!!

Answers

  • the code seems correct, and if all the dependencies are properly configured in eclipse, then it should run. Do you get the same error if you try a P3D sketch that doesn't use peasycam?

  • Hi, i do get that same error when not using peasycam. Even a simple sketch with the P3D renderer option gets hung up. When I use the Processing PDE, P3D sketches work as well by the way... not sure if that means the problem is definitely in the way I'm using Eclipse. Any other thoughts? Many thanks.

  • edited March 2014

    The "NoSuchMethodError" at the top of the stack makes me suspect you are mixing different versions of Processing jar files...

    This other thread might be useful:

    http://forum.processing.org/two/discussion/3687/cant-use-opengl-in-eclips

Sign In or Register to comment.