The jmh project's recommended approach of using the jmh-java-benchmark archetype to generate and launch a benchmark, currently runs into the following exception when the benchmark is launched against Java 22:
Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:252)
at org.openjdk.jmh.runner.Runner.run(Runner.java:208)
at org.openjdk.jmh.Main.main(Main.java:71)
This is because starting Java 22, annotation processors (during compilation) have been disabled (https://bugs.openjdk.org/browse/JDK-8306819). JMH uses annotation processors to generate certain resources that are then accessed at runtime. With the annotation processing disabled by default, these resources are no longer generated and thus not available at runtime.
Exception in thread "main" java.lang.RuntimeException: ERROR: Unable to find the resource: /META-INF/BenchmarkList
at org.openjdk.jmh.runner.AbstractResourceReader.getReaders(AbstractResourceReader.java:98)
at org.openjdk.jmh.runner.BenchmarkList.find(BenchmarkList.java:124)
at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:252)
at org.openjdk.jmh.runner.Runner.run(Runner.java:208)
at org.openjdk.jmh.Main.main(Main.java:71)
This is because starting Java 22, annotation processors (during compilation) have been disabled (https://bugs.openjdk.org/browse/JDK-8306819). JMH uses annotation processors to generate certain resources that are then accessed at runtime. With the annotation processing disabled by default, these resources are no longer generated and thus not available at runtime.
- relates to
-
JDK-8306819 Consider disabling the compiler's default active annotation processing
- Resolved
- links to
-
Commit(master) openjdk/jmh/2aa089c4
-
Review(master) openjdk/jmh/125