On JDK 21:
$ ./gradlew --version
------------------------------------------------------------
Gradle 9.2.0
------------------------------------------------------------
Build time: 2025-10-29 13:53:23 UTC
Revision: d9d6bbce03b3d88c67ef5a0ff31f7ae5e332d6bf
Kotlin: 2.2.20
Groovy: 4.0.28
Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM: 21.0.9 (Azul Systems, Inc. 21.0.9+10-LTS)
Daemon JVM: /Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home (no JDK specified, using current Java home)
OS: Mac OS X 15.7.1 aarch64
$ ./gradlew assemble --rerun-tasks
> Task :buildSrc:test
MultiReleaseJarPluginTests > validateJar() FAILED
java.lang.AssertionError at MultiReleaseJarPluginTests.java:143
4 tests completed, 1 failed
I see the same failure on JDK 17. On JDK 25 ./gradlew assemble passes.
This is with the main branch, git SHA 386c6cafc9d68e89af79dd9b8cb10940ca81a0fb. I'm seeing the same failure in CI on Linux.
Comment From: sdeleuze
That also prevents me to run tests in IDEA.
Task :validateMultiReleaseJar FAILED module jdk.jartool does not have a ModuleMainClass attribute, use -m
/
Maybe related to recent changes from #35773 in this area @bclozel ?
Comment From: sbrannen
I also just encountered this in a local Gradle build, where the build previously worked with JDK 17 configured for the current shell.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':validateMultiReleaseJar'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 374ms
4 actionable tasks: 4 executed
"
to contain:
"entry: META-INF/versions/17/Main.class, has a class version incompatible with an earlier version"
but did not.
Throwable that failed the check:
org.gradle.testkit.runner.UnexpectedBuildFailure: Unexpected build execution failure in /var/folders/_7/ll0c1sh52c5dfrvmq7j8l1x00000gn/T/junit-3208333937964262224 with arguments [validateMultiReleaseJar]