Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-9650

Errorprone on master/gradle no longer works with JDK-16

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: main (9.0)
    • Fix Version/s: main (9.0)
    • Component/s: general/build
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      JDK-16 no longer allows access to internal classes of any module by default. It looks like errorprone tries to access some internals from the Java compiler. This now fails with Exception. You have to fully open the module or pass `--illegal-access=allow`.

      We have 3 options:

      • install an update of errorprone
      • disable error-prone if we detect a runtimeJdk with version >=16
      • run javac as a separate forked task (i think we do already) and pass `--illegal-access=allow` or open the internal compile module.

      Error message:

      > Task :solr:solr-ref-guide:compileJava FAILED
      Exception in thread "main" java.lang.IllegalAccessError: class com.google.errorprone.ErrorProneJavacPlugin (in unnamed module @0x887af79) cannot access class com.sun.tools.javac.api.BasicJavacTask (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.api to unnamed module @0x887af79
      	at com.google.errorprone.ErrorProneJavacPlugin.init(ErrorProneJavacPlugin.java:38)
      	at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugin(BasicJavacTask.java:254)
      	at jdk.compiler/com.sun.tools.javac.api.BasicJavacTask.initPlugins(BasicJavacTask.java:228)
      	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:292)
      	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
      	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
      	at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
      

      Last failed build: https://jenkins.thetaphi.de/job/Lucene-Solr-master-Linux/29129/

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dweiss Dawid Weiss
                Reporter:
                uschindler Uwe Schindler
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h