在運行的時候常常出現如下錯誤:
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
完成以上兩步后,再運行時,便不再出現版本錯誤。