I have a project that is using Java 8.
Up to now in the pom we specified the source and target version as 1.8:
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
We want to utilize the "-release" Option of Java 9+ and added the following:
<maven.compiler.release>1.8</maven.compiler.release>
But now we get the following error:
Fatal error compiling: release version 1.8 not supported
We are using maven 3.5.3, the maven-compiler-plugin in version 3.8.0 and Java 10 to compile the project.
What is wrong here?
This should work
<maven.compiler.release>8</maven.compiler.release>
since the <release>
attribute works with the major versions of releases only.
By, the way this is assuming that this is a parameter used in the actual compiler-plugin configuration somewhat like :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With