IntelliJ is showing me this error
Matching the SDK/JDK with Project language level
To activate Java language features in the editor, you need to change your module's Project Structure or Module Settings to ensure your Project SDK matches the Project language level.
Project SDK (JDK) Java 1.5 matches project language level 5 ...
Java 1.6 matches language level 6 ...
Java 1.7 matches language level 7, and so on.
Example
Depending on your IntelliJ version, hit F4 or Ctrl + Alt + Shift - S on your module in the Project pane, or hit Ctrl + Shift - A and type either "Project Structure" or "Module Settings" to open the Project Structure dialog.
Under Project Settings section, click on the first item in the list, Project.
In the screenshot below, the Project SDK 1.8 (java version '1.8.0_72')
matches the selected language level SDK Default (8 - Lambdas, type annotations etc.)
because Java 1.8 matches SDK level 8. This activates the Java 8 language features for use in the editor.
If you don't have the JDK set up under Project SDK
that is a different problem. Solve that one first by clicking New
and adding a JDK.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…