Problems with OpenGl on Raspberry Pi

I am seeking help on resolving this OPENGL issue on the Raspberry PI. Here is the error message when trying to compile the code.

glGetError 0x500
glGetError 0x500
java.lang.ClassCastException: cannot be cast to com.jogamp.nativewindow.awt.AWTGraphicsConfiguration
   at java.awt.Container.addImpl(
   at java.awt.Container.add(
   at processing.opengl.PJOGL.initSurface(
   at processing.opengl.PGraphicsOpenGL.initPrimary(
   at processing.opengl.PGraphicsOpenGL.requestDraw(


  • P.S. I have upgraded Java to:

    java version "1.7.0_40" Java(TM) SE Runtime Environment (build 1.7.0_40-b43) Java HotSpot(TM) Client VM (build 24.0-b56, mixed mode)

  • edited January 2014 Answer ✓

    hello, the problem is that the opengl output cannot be drawn into an AWT frame (which it is what Processing uses):

    You would need to override Processing's frame and create a native window to draw the opengl canvas to. I started writing a utility library precisely for that purpose:

    It is far from finished, but you could try using it on the raspberry pi (you need to build and install it manually, is not included in Processing's build script):

    import processing.glw.*;
    void setup() {
      size(640, 360, GLW.P2D);
    void draw() {
      background(255, 0, 0);

    Because Processing still creates the AWT frame, you would briefly see two windows, but then the library hides Processing's so only the native window is visible at the end.

  • Hello,

    I have compiled and run the LargeStage example on the Raspberry Pi using the latest version of Raspbian (January 2014). I am getting the following error: Not a GL2ES2 implementation
        at jogamp.opengl.es1.GLES1Impl.getGL2ES2(
        at processing.opengl.PJOGL.getGL(
        at processing.glw.PNEWT.access$0(
        at processing.glw.PNEWT$DummyListener.init(
        at jogamp.opengl.GLDrawableHelper.init(
        at jogamp.opengl.GLDrawableHelper.displayImpl(
        at jogamp.opengl.GLDrawableHelper.display(
        at jogamp.opengl.GLAutoDrawableBase$
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(
        at jogamp.opengl.GLDrawableHelper.invokeGL(
        at jogamp.opengl.GLAutoDrawableBase.defaultDisplay(
        at com.jogamp.opengl.GLAutoDrawableDelegate.display(
        at processing.glw.PNEWT.requestDraw(
        at processing.opengl.PGraphicsOpenGL.requestDraw(


  • edited April 2014


    I have been having the same issue. Not a GL2ES2 implementation is resolved by editing as suggested by codeanticode. Then you need to build GLW, and then build Processing. There is another issue following that though (at least for me).


Sign In or Register to comment.