Error phenomenon
When using Idea to import a new project or upgrade an idea or create a new project, the following exception message will appear:
Error:java: Compilation failed: internal java compiler error
The reason for
this error is mainly due to the jdk version problem. There are three reasons here, one is insufficient memory, the other is the compiled version does not match, and the other is that the jdk version of the current project does not support.
Not enough storage
Use the shortcut key Ctrl+Alt+shift+S to open the jdk configuration of the project and increase the memory:
View the project’s jdk
File ->Project Structure->Project Settings ->Project or use the shortcut key Ctrl+Alt+shift+S to open the jdk configuration of the project:
Check whether these two places are consistent with the target jdk.
View the project’s jdk
Click Modules in the figure above to view the corresponding jdk version:
View java compiler version
When importing the java project, the probability of the problem here is more.
In response to this problem, reopening or modifying the content of the pom file (maven project) is likely to cause the jdk version to change to 1.5 again. If it is a maven project, you can specify jdk related information in the pom file:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build>
Similar Posts:
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- [Solved] Dynamic Web Module 3.0 requires Java 1.6 or newer
- [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] Error:java: error: release version 5 not supported & Switch Unrecognized String
- [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
- Error:java: javacTask: source release 8 requires target release 1.8
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- How to Solve Maven Project Error: Cannot change version of project facet Dynamic web module to 3.0/3.1
- Automatic version change of IntelliJ idea language level and Java compiler