Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Java JDK path in Android Studio Arctic Fox?

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

like image 991
Aliaksei Kisel Avatar asked Jun 24 '21 17:06

Aliaksei Kisel


People also ask

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

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.

Where is Java path in Android Studio?

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.

Is JDK installed with Android Studio?

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.

How do I find my JDK path?

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.


1 Answers

  1. Go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
  2. Choose JDK folder for Gradle JDK field
  3. Apply changes

enter image description here

NB: 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 (!)

like image 107
Aliaksei Kisel Avatar answered Sep 22 '22 10:09

Aliaksei Kisel