Error:java: Compilation failed: internal java compiler error

时间:2021-08-23 09:33:56

JDK版本不一致所导致的,修改下面的四个方面的JDK为相同版本即可。

1、查看项目的jdk 
File ->Project Structure->Project Settings ->Project 
Error:java: Compilation failed: internal java compiler error

2、查看工程的jdk
File ->Project Structure->Project Settings -> Modules -> Sources -> 
Error:java: Compilation failed: internal java compiler error

3、查看idea中Java配置 
Error:java: Compilation failed: internal java compiler error

4.修改pom.xml中的版本为1.8

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

 

参考资料:http://blog.****.net/jdjdndhj/article/details/70256989