Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Using Wrong JDK - Execution failed for task ':compileJava'. > invalid source release: 11

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

  • Error: Java: invalid target release: 11 - IntelliJ IDEA
  • Execution failed for task ':compileJava'. Gradle
  • Execution failed for task ':compileJava'. > invalid source release: 1.7

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

like image 690
SGT Grumpy Pants Avatar asked Dec 07 '22 09:12

SGT Grumpy Pants


1 Answers

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

Gradle JVM

like image 136
CrazyCoder Avatar answered Dec 09 '22 22:12

CrazyCoder