Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903596

JMH: Explicitly enable annotation processors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • None
    • None
    • tools
    • None
    • jmh

      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.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: