Refer to the
–
\rightarrow
→ Refer to article 1 and article 2
Content of the error
Error:java: error: release version 5 not supported
Error reason
Error setting Java compiler in project structure or Settings
The solution
1, the project structure
Click
File-Project Structure
File \rightarrow Project Structure
File→ProjectStructure
make sure that the SDK versions under the Project are the same
make sure that the Language level version in Sources is the same as the one used
make sure that the Module SDKl version is the same as the one used
2, the Preferences
-
- Click on Preferences(or Settings in Win version
-
- ) to search Java Compiler to ensure that the Target byte code version is the same as the selected version
3. Re-execution should have been resolved
4. One more question
Every time the pom
file is modified, the original setting is useless and the error is reported again. The solution is to add maven-compiler-plugin to
in the parent pom and specify the JDK version to be used by the JDK
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>13</source>
<target>13</target>
</configuration>
</plugin>
</plugins>
</build>