Java Version 25ea Parsing Fails
Affected version
3.14
Bug description
I get the following error, plus a link to a most general web-page without a hint what’s wrong:
ERROR Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project … Fatal error compiling: error: release version 24 not supported
I finally understood. I wanted to test the new AOT features of Java 24. But my Linux distro (Devuan testing) skipped that version. They offer Java 25 instead. This still reports its version as “25ea”, which you apparently don’t understand.
please provide output of:
mvn -v
Sorry for the delay! (I had to reinstall this, since I’d switched to regular v24 in the meantime.)
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/opt/maven/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /opt/maven
Java version: 25-ea, vendor: Debian, runtime: /usr/lib/jvm/java-25-openjdk-amd64
Default locale: eo, platform encoding: UTF-8
OS name: "linux", version: "6.12.22-amd64", arch: "amd64", family: "unix"
Can you show how to reproduce it?
from my test:
[INFO] --- compiler:3.14.0:compile (default-compile) @ test ---
[INFO] Recompiling the module because of changed source code.
[INFO] Compiling 1 source file with javac [debug deprecation release 24] to target/classes
[INFO]
mvn -v
Apache Maven 3.9.10 (5f519b97e944483d878815739f519b2eade0a91d)
Maven home: /Users/slawomir.jaranowski/.sdkman/candidates/maven/3.9.10
Java version: 25-ea, vendor: Oracle Corporation, runtime: /Users/slawomir.jaranowski/.sdkman/candidates/java/25.ea.23-open
The initial output
...release version 24 not supported
indicates that you have not used JDK 24+ very likely you are using JDK23 or less... The WARNING output at the beginning:
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/opt/maven/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
can be suppressed via adding the mentioned option to your .mavenrc (in your home directory) or using Maven 3.9.10 instead (shown by @slawekjaranowski )...