9

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

2 Answers 2

13
  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 (!)

Sign up to request clarification or add additional context in comments.

5 Comments

This is the Gradle JDK, not the JDK used by the IDE
@Aliaksei Kisel In my Arctic Fox I don't have this option, any solution? stackoverflow.com/questions/69704289/…
@babayaro It seems that Gradle wasn't configured for your project. See Project structure
It's always amazing how difficult to find this in the menu, I always need to rely on Stackoverflow to locate it.
For latest Android Studio (eg: Android Studio Flamingo | 2022.2.1), the Settings option can be found by going to Android Studio > Settings
1

Android Studio Bumblebee | 2021.1.1 Patch 1 has a fix for "Env variables not sourced when launched from Mac OS X to Monterey Dock" - See https://androidstudio.googleblog.com/2022/02/android-studio-bumblebee-202111-patch-1.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.