intellij idea - Error: java: invalid source release 1.9
Maven Projects - and Project Structure[imported as maven in IntelliJ]
Try - If any of below pom entries present - values should be same at java level
<java.version>16</java.version>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
- Project Structure -> Project language level
- Module -> Language level
GRADLE projects
Since we started working with GRADLE,
Build.gradle: - even below line didn't help
sourceCompatibility = '16'
I am getting this ERROR most of the time and Solution is Change Gradle JVM to XX
Preferences | Build, Execution, Deployment | Build Tools | Gradle -> JVM
Select the project, then File > ProjectStructure > ProjectSettings > Modules -> sources You probably have the Language Level set at 9:
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
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
I have had the same problem. There is an answer:
- 1.CTRL + ALT + SHIFT + S;
- Then go to "Modules";
- "Dependencies;
- Change "Module SDK".
Got it! Now u have Java 9!