Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5147

JEP 396 present in JDK 16+28 / 17+1 causes IllegalAccessError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Next, 12.2
    • Next
    • None

    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.

       

       

      Attachments

        1. messages.log
          63 kB
          Ludovic HOCHET

        Activity

          People

            Unassigned Unassigned
            lhochet Ludovic HOCHET
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: