IntelliJ Using Wrong JDK – Execution failed for task ‘:compileJava’. > invalid source release: 11

Total
1
Shares

My project runs on the command line but fails to run in IntelliJ. I’ve tried all of the solutions in the following questions:

enter image description here
enter image description here
enter image description here

However I did notice that Gradle is compiling the project with the wrong JDK

Does anyone know why InteliJ is not using the JDK I defined?

enter image description here

I also tried overriding JAVA_HOME

enter image description here

Solution

You may try this solution – https://akashmittal.com/code-example-execution-failed-for-task-compilejava-invalid-source-release-11/

Configure IntelliJ IDEA Gradle JDK: Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Gradle JVM.

Gradle JVM
Leave a Reply

Your email address will not be published. Required fields are marked *