intellij idea - Error: java: invalid source release 1.9 intellij idea - Error: java: invalid source release 1.9 java java

intellij idea - Error: java: invalid source release 1.9


Select the project, then File > ProjectStructure > ProjectSettings > Modules -> sourcesYou probably have the Language Level set at 9:

screenshot

Just change it to 8 (or whatever you need) and you're set to go.

Also, check the same Language Level settings mentioned above, under Project Settings > Project

enter image description here


Sometimes the problem occurs because of the incorrect version of the project bytecode.

So verify it : File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler -> Project bytecode version and set its value to 8

Example


I have had the same problem. There is an answer:

  • 1.CTRL + ALT + SHIFT + S;
    1. Then go to "Modules";
    2. "Dependencies;
    3. Change "Module SDK".

Got it!Now u have Java 9!