java: Compilation failed: internal java compiler error

1、查看项目的jdk(Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings ->Project


image.png

2、查看工程的jdk(Ctrl+Alt+shift+S)
File ->Project Structure->Project Settings -> Modules -> (需要修改的工程名称) -> Sources ->


image.png

3、查看idea中Java配置
File ->Setting ->Build,Execution,Deployment -> Compiler -> Java Compiler


image.png

上面三步做完还是失败的话

清除IDEA缓存 重启IDEA
File->Invalidate Caches/Restart


image.png

原文链接

推荐阅读更多精彩内容