I cannot update the Java JDK or Android SDK path in Android Studio.
To update the default JDK or Android SDK:
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
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.
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.
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.
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.
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)").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With