1.File – Project Structure – Project – Project SDK: Change it to Java 1.8.XX
2.File – Project Structure – Project – Language Level: SDK 8 (in my case SDK default was already 8)

3.File --Project Structure – Modules – Sources – SDK 8 (in my case SDK default was already 8)

4.File – Settings --Build, Execution, Deployment – Compiler – Java Compiler – Project bytecode version --1.8

5.File – Settings – Build, Execution, Deployment – Compiler --Java Compiler – Per-module bytecode version – Target bytecode version – 1.8

相关文章: