RFR: 8349944: [JMH] sun.misc.UnsafeOps cannot access class jdk.internal.misc.Unsafe

Nicole Xu duke at openjdk.org
Wed Feb 19 09:34:26 UTC 2025


The UnsafeOps JMH benchmark fails with the following error:

      java.lang.IllegalAccessError: class org.openjdk.bench.sun.misc.UnsafeOps (in unnamed module @0x520a3426) cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @0x520a3426

To resolve this, we add the required `--add-opens` flag to grant access for the benchmark.

-------------

Commit messages:
 - 8349944: [JMH] sun.misc.UnsafeOps cannot access class jdk.internal.misc.Unsafe

Changes: https://git.openjdk.org/jdk/pull/23686/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23686&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8349944
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/23686.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23686/head:pull/23686

PR: https://git.openjdk.org/jdk/pull/23686


More information about the core-libs-dev mailing list