I’m trying to run sample jcstress tests. I’ve cloned the jcstress repository and ran the following commands as the README.md prescribes:
mvn clean verify -pl jcstress-samples -am
java -jar jcstress-samples/target/jcstress.jar
However, the second command fails instantly with the following error:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.Reader.<init>(Reader.java:168)
at java.base/java.io.InputStreamReader.<init>(InputStreamReader.java:89)
at org.openjdk.jcstress.infra.runners.TestList.getTests(TestList.java:51)
at org.openjdk.jcstress.infra.runners.TestList.tests(TestList.java:104)
at org.openjdk.jcstress.JCStress.getTests(JCStress.java:222)
at org.openjdk.jcstress.JCStress.getConfigs(JCStress.java:99)
at org.openjdk.jcstress.JCStress.run(JCStress.java:59)
at org.openjdk.jcstress.Main.main(Main.java:57)
Upon checking TestList.java:51
, it seems the issue is caused by the META-INF/TestList
file not being created.
My Java version:
java --version
openjdk 23.0.1 2024-10-15
OpenJDK Runtime Environment (build 23.0.1+11-39)
OpenJDK 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing)
My Maven version:
mvn --version
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /opt/homebrew/Cellar/maven/3.9.9/libexec
Java version: 23.0.1, vendor: Homebrew, runtime: /opt/homebrew/Cellar/openjdk/23.0.1/libexec/openjdk.jdk/Contents/Home
Default locale: ru_EE, platform encoding: UTF-8
OS name: "mac os x", version: "15.1.1", arch: "aarch64", family: "mac"
Has anyone encountered this issue before? It might be a bug in jcstress, but unfortunately, it seems they don’t allow bug reports.
It looks like this might be the reason why the META-INF/TestList
is not created in JDK 23.
After explicitly enabling the annotation processing like this, the issue was resolved.