After running the Pom.xml file in idea, the compilation environment becomes 1.5, resulting in a series of compilation problems that are inconvenient.
Here's how to fix it:
Add the following code to the "Pom.xml":
<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target></properties>
Then press "Ctrl+shift+alt+s" to open the project configuration and set the language level of modules to "8".
Finally press "Ctrl+alt+s" to open the settings, search "Java compiler", the default JDK and the current modual JDK version to switch to 1.8. You can also fundamentally resolve the problem by modifying Maven's settings file to add the following to the <profiles> tag:
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
The compilation environment becomes jdk1.5 after you run the Maven pom.xml file