IntelliJ IDEA遇到编译失败Compilation failed:internal java compiler error的解决办法

IntelliJ IDEA提示编译失败如下:
IntelliJ IDEA遇到编译失败Compilation failed:internal java compiler error的解决办法_第1张图片
解决办法:
1、项目名称处右击,点击"Open Moudle Settings".
2、点击左边列表“Project”,右边Project SDK选择1.8,Project language level选择“8 - Lambda, type annotations etc."
3、点击左边列表“Moudles,右边Source下的Language level选择“8 - Lambda, type annotations etc.",保存设置点击“OK”
4、点击左上角“IntelliJ IDEA", 点击Preference, 点击“Build, Execution, Deployment"下的“Java Compiler”,如下图:

IntelliJ IDEA遇到编译失败Compilation failed:internal java compiler error的解决办法_第2张图片

将"Target byte code version"改为1.8,保存设置点击“OK”如下图:
IntelliJ IDEA遇到编译失败Compilation failed:internal java compiler error的解决办法_第3张图片

完成以上设置,重新编译即可。

你可能感兴趣的:(JAVA)