In application.properties I specified java and maven version as
java.runtime.version=11
maven.version=4.0.0
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project heroku-spring: Fatal error compiling: invalid target release: 11
How can I solve it?
You can change maven and java versions in your pom.xml file.
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
Creating system.properties
file with the property java.runtime.version=11
in the root directory helped me with the same problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.