jzy3d / jogl

Mirror of https://jogamp.org/cgit/jogl.git/
Other
6 stars 2 forks source link

Caught AppContextInfo(Bug 1004) IllegalAccessException: class com.jogamp.nativewindow.awt.AppContextInfo cannot access class sun.awt.AppContext (in module java.desktop) because module java.desktop does not export sun.awt to unnamed module @34a3d150 on thread main #11

Open jzy3d opened 2 years ago

jzy3d commented 2 years ago

Discussed here.

May workaround this with VM option up to Java 16 included : java --illegal-access=permit -jar my.jar

This won't work for Java 17. At build/test time, Julien suggests

I've just added this at line 486 in jogl/make/build-test.xml: <jvmarg line="--add-opens=java.desktop/sun.awt=ALL-UNNAMED"/>

So running programs with these JVM args fixes the problem : --add-opens=java.desktop/sun.awt=ALL-UNNAMED

Which also works to avoid this illegal access exception at runtime on Java 17.