0

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?

  • Maybe this is related to your issue? https://stackoverflow.com/questions/53604111/heroku-cannot-deploy-java-11-spring-boot-app – Sh Svyatoslav Oct 07 '20 at 12:01

2 Answers2

0

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>
Habil
  • 540
  • 1
  • 8
  • 20
0

Creating system.properties file with the property java.runtime.version=11 in the root directory helped me with the same problem.

jo23
  • 23
  • 4