Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot update JDK location in Android Studio

I cannot update the Java JDK or Android SDK path in Android Studio.

To update the default JDK or Android SDK:

  1. Open Android Studio
  2. Go to Quick Start -> Configure -> Project Defaults -> Project Structure
  3. Change the JDK location

My problem/question:

The "Apply" button isn't clickable and if I press "OK" the JDK or Android SDK locations are never updated. Here is a video showing what happens when I try to update the location. How can I fix this?

Expected results:

Android Studio should update the JDK and/or SDK locations.

Additional info:

JAVA_HOME environment variable matches the location I am trying to update in Android Studio.

Android Studio 1.5.1 Build 141.2456560

Windows 10 Pro

like image 835
Jared Rummler Avatar asked Dec 10 '15 10:12

Jared Rummler


People also ask

How do I change the default JDK location in Android Studio?

Navigate to File > Project Structure > SDK Location. Upon navigating there you will find that a tab named “JDK Location”, select that and then you can set the JDK path for the current project on which you're working.

Where is JDK location in Android Studio?

Open your project in Android Studio and select File > Settings... > Build, Execution, Deployment > Build Tools > Gradle (Android Studio > Preferences... > Build, Execution, Deployment > Build Tools > Gradle on a Mac). Under Gradle JDK, choose the Embedded JDK option.

How do I fix SDK location not found?

Close the current project and you'll see a pop-up with a dialog which will then proceed to Configure option. Configure -> Project Defaults -> Project Structure -> SDKs on left column -> Android SDK Home Path -> give the exact path as you did on local. properties and select Valid Target.

Does Android Studio automatically install JDK?

You must install Oracle JDK before installing Android Studio, so please don't start this step until you have completed Step 1 above. Download Android Studio from the following address: Android Studio Download Page.


1 Answers

There was a warning about the Android SDK location having spaces in the path. Once I moved the SDK to a location without spaces and updated the SDK location in Android Studio I was then able to update the Java JDK location using the steps outlined in the question above.

This may be a more common problem in the future since the Android SDK Windows installer will always place the Android SDK in a directory with spaces ("Program Files" or "Program Files (x86)").

like image 97
Jared Rummler Avatar answered Oct 16 '22 21:10

Jared Rummler