question
Created a new Maven project in Intellij idea , and the runtime error is as follows: Error: java does not support release version 5
solution
1. Reason
It is because the jdk version in several places in the default configuration in ideal is inconsistent with the actual
2. Solutions
Direct Ctrl+shit+alt+s appears the following version
Modify to the corresponding version, then save the application and close it.
Then this error occurs again:
This time go to Ctrl+shit+s, go to the interface below and select the corresponding version
In fact, the maven version is wrong. The function of this section in the pom.xml file is to prevent the above error from being reported:
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>