【IDEA】Error: java: Compliance level '1.6' is incompatible with target level '1.8'. A compliance level '1.8' or better is required解决办法

在运行的时候常常出现如下错误:

Error: java: Compliance level '1.6' is incompatible with target level '1.8'. A compliance level '1.8' or better is required

解决办法如下:

1. 点击File标签里的Settings, 选择Build,Execution,Deployment->Compiler->Java Compiler,将其中的其中的版本改成1.8;

2. 点击File标签里的Project Structure,选择Project Settings->Modules,选择1.8版本对应的language level

完成以上两步后,再运行时,便不再出现版本错误。

原文地址:https://www.cnblogs.com/lauren1003/p/8432442.html