Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Next, 12.2
-
None
-
Product Version = Apache NetBeans IDE DEV (Build dev-81f31d3a342ab3d04e1e06f82a9733b71b56bb1a) (#81f31d3a342a)
Operating System = Windows 10 version 10.0 running on amd64
Java; VM; Vendor = 17-internal; OpenJDK 64-Bit Server VM 17-internal+1-adhoc.Ludovic.jdk; LH
Runtime = OpenJDK Runtime Environment 17-internal+1-adhoc.Ludovic.jdkProduct Version = Apache NetBeans IDE DEV (Build dev-81f31d3a342ab3d04e1e06f82a9733b71b56bb1a) (#81f31d3a342a) Operating System = Windows 10 version 10.0 running on amd64 Java; VM; Vendor = 17-internal; OpenJDK 64-Bit Server VM 17-internal+1-adhoc.Ludovic.jdk; LH Runtime = OpenJDK Runtime Environment 17-internal+1-adhoc.Ludovic.jdk
Description
With JDK 16+28 / 17+1 NetBeans is showing IllegalAccessError:
java.lang.IllegalAccessError: superclass access check failed: class org.netbeans.lib.nbjavac.services.CancelAbort (in unnamed module @0x1af58186) cannot access class com.sun.tools.javac.util.Abort (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x1af58186
Recompiling the JDK without the JEP 396 commit removes the issue, so it seems a consequence of it.
Adding
-J--illegal-access=permit
to netbeans_default_options in netbeans.conf restore the old behaviour.
Or adding
-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
helps too.