Reply – com.jogamp.opengl.swt.GLCanvas does not work with Eclipse 4.8 under Linux
Your Name
Subject
Message
or Cancel
In Reply To
com.jogamp.opengl.swt.GLCanvas does not work with Eclipse 4.8 under Linux
— by Felix Hirsch Felix Hirsch
Hi,

I am filing a JOGL/SWT problem here since the JOGL bugtracker is still down (http://forum.jogamp.org/JogAmp-bugzilla-down-td4038904.html).

When using com.jogamp.opengl.swt.GLCanvas under Linux with Eclipse 4.8 (SWT 3.107) an Exception is thrown in com.jogamp.nativewindow.swt.SWTAccessor class during initialization.

JOGL tries to access the member field "GTK_VERSION" of SWT's internal OS class via reflection. The class still exists but the member is no more present in SWT 3.107.  I've checked the source code of OS class and it is not there any more but was in SWT 3.105 which comes along with Eclipse 4.6.

To reconstruct the problem one simply has to access a member of SWTAccessor:


    try {
        boolean x11 = SWTAccessor.isX11GTK;
        System.out.println(x11);
    } catch (Throwable e) {
        e.printStackTrace();
    }


The resulting exception is:


    Caused by: java.lang.NoSuchFieldException: GTK_VERSION
     at java.lang.Class.getField(Class.java:1703)
            at com.jogamp.nativewindow.swt.SWTAccessor.<clinit>(SWTAccessor.java:183)
            ... 1 more


Unfortunally SWT's own GLCanvas is currently not usable as well as it has no depth buffer since GTK3.16 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=539220) and therefore JOGL can't be used with Eclipse 4.8 in any way.