Maven error: release version 1.13 not supported

A simple mvn compile and prompts the following error message:

P.S Tested with Java 13

Terminal

$ mvn compile

Fatal error compiling: error: release version 1.13 not supported
pom.xml

	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-compiler-plugin</artifactId>
		<version>3.8.0</version>
		<configuration>
			<source>1.13</source>
			<target>1.13</target>
		</configuration>
	</plugin>

Solution

No more 1.13, uses 13 instead.

pom.xml

	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-compiler-plugin</artifactId>
		<version>3.8.0</version>
		<configuration>
			<source>13</source> <!-- 1.8,1.9,1.10,11,12,13 -->
			<target>13</target>
		</configuration>
	</plugin>

To enable the preview feature in Java 13, try this:

pom.xml

	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-compiler-plugin</artifactId>
		<version>3.8.0</version>
		<configuration>
			<release>13</release>
			<compilerArgs>
				--enable-preview
			</compilerArgs>
		</configuration>
	</plugin>

References

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar