9

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

SGT Grumpy Pants
  • 4,118
  • 4
  • 42
  • 64

3 Answers3

28

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

Gradle JVM

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
1

Finally, this worked for me:

  1. Close IntelliJ
  2. On the command line, run sdk default java 11.0.11.9.1-amzn
  3. Restart IntelliJ
  4. Rerun the app within IntelliJ

enter image description here

Note:

I'm still interested to know how to override the SDKMAN setting within IntelliJ. If anyone knows, please adda comment or answer. Thanks!

SGT Grumpy Pants
  • 4,118
  • 4
  • 42
  • 64
0

USE SDKMAN to install the java versions . configure the installed sdks into IntelliJ and use the appropriate one for the project