Im trying to compile some code in I\'m using Intellij Ultimate 13.1.4, but I get the following error and I have no idea what it means:
Information:Using java
For Grails users, apply these declarations in your BuildConfig.groovy file:
grails.project.target.level = 1.6 //or 1.7;1.8 and so on
grails.project.source.level = 1.6 //or 1.7;1.8 and so on
You need to click to the project Open Module Settings and change the path of your JDK, if in the file POM you use jdk 1.8, configure jdk 1.8 with correct path.
Andreas Lundgren's answer worked and I was able to compile and run my app.
However, when I tried to run the project's associated JUnit tests I received the same error. Running
gradle -version
from Windows command prompt showed that gradle was still picking up the incorrect jdk. To fix it I had to set the JAVA_HOME
environment variable to point to the correct jdk and restart IntelliJ.
As Andreas mentioned all about:
Error:java: invalid source release: 8 in IntelliJ
Error:java: invalid source release: 13 in IntelliJ
Error:java: invalid source release: 14 in IntelliJ...
OR whatever version you are using in Java...
The problem will exist if you do not have it matching inside the below code:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
This 1.8 in my case, must be matching on your device through MAVEN project library, settings, preferences, project setting and SDK.
I was recently facing the same problem. This Error was showing on my screen after running my project main file. Error:java: invalid source release: 11 Follow the steps to resolve this error
After running You will see error is resolved..
I had the same issue when "downgrading" a project from Java 8 to Java 6. The reason was that it was not changed at all places in IntelliJ.
In IntelliJ 13.1.4 I had to change Java and SDK version on the following places not to get this error:
The last bullet was the one that was not updated in my case. Once I changed this, the error disappeared.