3

I updated my Android Studio to Electric Eel. The problem is that every time I create a new project, I have to select the correct Gradle JDK from the Gradle of Settings. Otherwise, it gets the wrong JDK path and throws an error. In Dolphin, it was always getting the correct JDK.

How can I set Android Studio to automatically choice my java home version?

The other JDK choices are in below. Should I delete others? Or should I give specified location?

enter image description here

Sezai
  • 85
  • 6
  • It is recommended to use ```jdk``` supplied together with ```Gradle JDK```. – Gleichmut Jan 18 '23 at 13:09
  • I have the same issue. after Eel upgrade. When it fails, this notification appears at the bottom: Multiple Gradle daemons might be spawned because the Gradle JDK and JAVA_HOME locations are different. Project 'Auth Module' is using the following JDK location when running Gradle: 'C:/Users/Mike/.jdks/corretto-1.8.0_332' The system environment variable JAVA_HOME is: 'C:\Program Files\Android\Android Studio\jbr' If you dont need to use different paths (or if JAVA_HOME is undefined), youcan avoid spawning multiple daemons by setting JAVA_HOME and the JDK locationto the same path. – Mike Feb 15 '23 at 03:24
  • It is fixed (temporarily) by selecting one of the others like "Use embedded LDK version" – Mike Feb 15 '23 at 03:25

1 Answers1

-1

Update JAVA_HOME to C:\Program Files\Android\Android Studio\jbr

Open File Explorer and Navigate to C:\Program Files\Android\Android Studio\jbr and copy everything and paste it to C:\Program Files\Android\Android Studio\jre

Restart your PC and try to run the project again.