sunmingtao / sample-code

3 stars 4 forks source link

java: error: release version 15 not supported #248

Closed sunmingtao closed 3 years ago

sunmingtao commented 3 years ago

Start a spring boot app with java 11 in Intellij Ultimate

image

Running mvn clean install:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project soccer-bet-rest-api: Fatal error compiling: error: invalid target release: 15 -> [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

pom.xml

<properties>
    <java.version>11</java.version>
</properties>
sunmingtao commented 3 years ago

Somehow the language level in Module is set to 15. image

Change it to 11, then rerun mvn clean install

I don't know how it caused command line mvn clean install to fail.