How can I set the new path for Java JDK? I tried to change the environment variables but it did not work.
IDE: Android Studio Arctic Fox | 2020.3.1 Beta 4
IDE: Android Studio Bumblebee | 2021.1.1
Set the JDK version 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. Click OK.
Method #1: For Android Studio Version 4.2 and Above 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.
A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and higher, and this is the JDK version we recommend you use for your Android projects.
Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.
File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
Gradle JDK
fieldApply
changesNB: If you haven't Java environment on your PC, go to https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html and download Java jdk for your platform.
NB2: It's JDK for your Gradle, not for your source code compiler (!)
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