To change Android Studio’s JDK, follow these steps:
-
Go to File > Project Structure.
-
Select the SDK Location section in the list of the left.
-
Deselect the Use embedded JDK (recommended) option.
-
Enter the absolute path of your installed JDK in the text box.
-
Digi also recommends you lower the default memory setting for Gradle (org.gradle.jvmargs property):
-
Create a file called gradle.properties in the root of your project.
-
Enter the following contents and save.
# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx768m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true
-