Intellij idea new Maven project, always default language level 5 and Java Compiler 1.5.
Here are two ways to modify:
1. Manual modification:
Error:Error:java:Compilation failed:internal java compiler Error
How to resolve: Target bytecode Version = 1.8, Java Compiler, File--Settings
Error:Error:java: lambda expression is not supported in-source 1.5 (use-source 8 or later to enable lambda expression)
Workaround: File, Project Structure, Language level:8-lambdas,type annotations etc.
- Manual modification Defects: Language Level 5 and Java Compiler 1.5 are automatically reset each time the MAVEN project's Pom.xml is updated.
2. Use the plugin to automatically modify:
Add the plugin under the <build> tab under the Pom.xml of the MAVEN project, and modify the language level and Java compiler to the specified version (this example specifies 8).
<Build> <Plugins> <plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-compiler-plugin</Artifactid> <version>3.7.0</version> <Configuration> <!--Modify language level - <Source>8</Source> <!--Modify Java Compiler - <Target>8</Target> </Configuration> </plugin> </Plugins> </Build></Project>
Auto Reset language Level 5 with Java complier 1.5