public lookup fails with IllegalAccessException when used while module system is being initialized

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 23
    • Affects Version/s: 23
    • Component/s: core-libs
    • None

      Consider this trivial command:

      java --add-modules=foo.bar.notpresent -version

      On mainline (and I could reproduce this only on mainline - works fine on Java 21 and 22) when that command is executed, I get:

      Error occurred during initialization of boot layer
      java.lang.ExceptionInInitializerError
      Caused by: java.lang.RuntimeException: java.lang.IllegalAccessException: symbolic reference class is not accessible: class java.lang.Class, from public Lookup

      On Java 21 and 22, I rightly get a FindException:

      Error occurred during initialization of boot layer
      java.lang.module.FindException: Module foo.bar.notpresent not found

      I'm on macos M1, if that matters.

            Assignee:
            Mandy Chung (Inactive)
            Reporter:
            Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: