Updated guide for using Processing 3 in Eclipse

edited May 2016 in Share Your Work

Hello, here is an updated guide for using Processing 3 in Eclipse.

https://github.com/DigitalMediaAcademy/Programming-with-Java-2016/wiki/Using-Processing-in-Eclipse

A couple more things to add in regards to using Processing once you get it set up:

  • Accounting for colors by getting used to using ints and bit-masking, using individual rgb variables, or using java.awt.Color.

  • Passing the PApplet to any separate Java files outside of the client class.

  • importing other Processing libraries.

Please let me know if you see any errors, or suggestions for things to add.

Comments

  • Hot damn, thank you! For sure going to give this a try later today. I'll let you know how it goes.

  • edited July 2016

    At last, all the other tutorials seem to be obsolete! Thank you :)

    With your technique I get this error when including P3D, any Ideas?

    java.lang.NoClassDefFoundError: com/jogamp/opengl/GLException
        at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:653)
        at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:525)
        at processing.opengl.PGraphics3D.<init>(PGraphics3D.java:35)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at processing.core.PApplet.makeGraphics(PApplet.java:2216)
        at processing.core.PApplet.createPrimaryGraphics(PApplet.java:2290)
        at processing.core.PApplet.initSurface(PApplet.java:10322)
        at processing.core.PApplet.runSketch(PApplet.java:10261)
        at processing.core.PApplet.main(PApplet.java:10024)
        at processing.core.PApplet.main(PApplet.java:10006)
        at MAIN.main(MAIN.java:10)
    Caused by: java.lang.ClassNotFoundException: com.jogamp.opengl.GLException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 14 more
    java.lang.NoClassDefFoundError: com/jogamp/opengl/GLException
        at processing.opengl.PGraphicsOpenGL.createPGL(PGraphicsOpenGL.java:653)
        at processing.opengl.PGraphicsOpenGL.<init>(PGraphicsOpenGL.java:525)
        at processing.opengl.PGraphics3D.<init>(PGraphics3D.java:35)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at processing.core.PApplet.makeGraphics(PApplet.java:2216)
        at processing.core.PApplet.createPrimaryGraphics(PApplet.java:2290)
        at processing.core.PApplet.initSurface(PApplet.java:10322)
        at processing.core.PApplet.runSketch(PApplet.java:10261)
        at processing.core.PApplet.main(PApplet.java:10024)
        at processing.core.PApplet.main(PApplet.java:10006)
        at MAIN.main(MAIN.java:10)
    Caused by: java.lang.ClassNotFoundException: com.jogamp.opengl.GLException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 14 more
    Exception in thread "main" java.lang.RuntimeException: com/jogamp/opengl/GLException
        at processing.core.PApplet.makeGraphics(PApplet.java:2246)
        at processing.core.PApplet.createPrimaryGraphics(PApplet.java:2290)
        at processing.core.PApplet.initSurface(PApplet.java:10322)
        at processing.core.PApplet.runSketch(PApplet.java:10261)
        at processing.core.PApplet.main(PApplet.java:10024)
        at processing.core.PApplet.main(PApplet.java:10006)
        at MAIN.main(MAIN.java:10)
    

    Edit: Could you please explain how I can add 'install' processing, so when I create a new project in Eclipse I can do New>Project>Processing?

  • I added a few more .jar and that solved the problem.

Sign In or Register to comment.