There will be such a problem when importing project and build from other places
At present, the local is openjdk11.0.2
Change the idea configuration as follows
File > Settings
If STR in switch is string type, the following two parts should be changed:
File > project structure
However, when the POM changes and rebuilds, the above three settings will automatically change back to the default settings, so the & lt; project> Add the Maven compiler plugin plug-in, and specify the JDK version to be used by JDK (I currently use openjdk 11.0.2, and I find that it’s OK to directly configure an 11, and the settings in the above three places will automatically change to the 11 option)
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <source>11</source> <target>11</target> </configuration> </plugin> </plugins> </build>
Similar Posts:
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- Error:java: javacTask: source release 8 requires target release 1.8
- [Solved] Dynamic Web Module 3.0 requires Java 1.6 or newer
- Automatic version change of IntelliJ idea language level and Java compiler
- [Solved] Error:java: Compilation failed: internal java compiler error
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- Dynamic Web Module 3.1 requires Java 1.7 or newer
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- Solve the error in Maven project packaging: error injecting constructor
- [Solved] Spring Start Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project gulimall-coupon: There are test failures. Please refer to D:\m1\0613\mall-coup