Reputation: 15
I wanted to deploy my application to heroku server and I am facing this problem. Any idea?
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.339 s
[INFO] Finished at: 2021-08-09T04:05:01Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project russion_spring_boot: Fatal error compiling: invalid target release: 11 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
<properties>
<java.version>15.0.1</java.version>
</properties>
Upvotes: 0
Views: 150
Reputation: 1606
Logs depict the error - invalid target release: 11
. Basically this error means that you have mentioned higher/mismatched version of Java in maven compiler's source and target java version settings in your pom.xml
compared to the JDK which is being pointed out by JAVA_HOME
environment variable.
To fix this error, just check the Java version in pom.xml
and JAVA_HOME
. They should match.
To know more about this issue, check this post - https://dzone.com/articles/how-to-fix-invalid-target-release-17-18-19-or-110
Upvotes: 2