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

Alan Bateman alanb at openjdk.org
Wed Feb 19 10:32:53 UTC 2025


On Wed, 19 Feb 2025 07:53:15 GMT, Nicole Xu <duke at openjdk.org> wrote:

> 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.

This micro was created for sun.misc.Unsafe, not jdk.internal.misc.Unsafe.  The change for JDK-8332744 should not have changed this test.

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

PR Comment: https://git.openjdk.org/jdk/pull/23686#issuecomment-2668214764


More information about the core-libs-dev mailing list