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

Viewed 6825
3 Answers

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

Gradle JVM

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!

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

Related