diff options
-rw-r--r-- | make/scripts/tests.sh | 6 | ||||
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java | 25 |
2 files changed, 18 insertions, 13 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index e0fb6d55d..928b6dcc2 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -112,7 +112,7 @@ function jrun() { #D_ARGS="-Dnewt.debug=all" #D_ARGS="-Djogl.debug=all -Dnewt.debug=all" #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all" - D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" + #D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all" #D_ARGS="-Djogamp.debug.NativeLibrary=true -Djogamp.debug.JNILibLoader=true" #D_ARGS="-Djogl.debug.GLContext -Djogamp.debug.NativeLibrary -Djogamp.debug.JNILibLoader -Djogl.debug.DebugGL -Djogl.debug.GLDebugMessageHandler" @@ -454,10 +454,10 @@ function testawtswt() { # # HiDPI # -testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* +#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2SimpleNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $* -#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* +testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $* diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java index 0f4a70ddc..6158e792e 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java @@ -91,6 +91,8 @@ public class JAWTUtil { private static final Method isQueueFlusherThread; private static final boolean j2dExist; + // Unavailable since Java_9 + // 'illegal reflective access to sun.awt.SunToolkit.awtLock/Unlock' private static final Method sunToolkitAWTLockMethod; private static final Method sunToolkitAWTUnlockMethod; private static final boolean hasSunToolkitAWTLock; @@ -354,15 +356,19 @@ public class JAWTUtil { @Override public Object run() { final PrivilegedDataBlob1 d = new PrivilegedDataBlob1(); - try { - final Class<?> sunToolkitClass = Class.forName("sun.awt.SunToolkit"); - d.sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{}); - d.sunToolkitAWTLockMethod.setAccessible(true); - d.sunToolkitAWTUnlockMethod = sunToolkitClass.getDeclaredMethod("awtUnlock", new Class[]{}); - d.sunToolkitAWTUnlockMethod.setAccessible(true); - d.ok=true; - } catch (final Exception e) { - // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5 + if( PlatformPropsImpl.JAVA_9 ) { + d.ok=false; + } else { + try { + final Class<?> sunToolkitClass = Class.forName("sun.awt.SunToolkit"); + d.sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{}); + d.sunToolkitAWTLockMethod.setAccessible(true); + d.sunToolkitAWTUnlockMethod = sunToolkitClass.getDeclaredMethod("awtUnlock", new Class[]{}); + d.sunToolkitAWTUnlockMethod.setAccessible(true); + d.ok=true; + } catch (final Exception e) { + // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5 + } } try { final GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); @@ -392,7 +398,6 @@ public class JAWTUtil { } } hasSunToolkitAWTLock = _hasSunToolkitAWTLock; - // hasSunToolkitAWTLock = false; } jawtLock = LockFactory.createRecursiveLock(); |