将以下对应配置一致即可。 File–>Project Structure File–>Settings–>Build,Execution,Deployment–>Compiler–>Java Compiler 转载自idea报错:Error:java不支持发行版本5的解决方法