Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio 1.1 - change JRE used for running studio

I have Android Studio 1.1 on a Windows 8.1 machine.

There are several JDKs installed on my machine (1.6, 1.7, 1.8) and Android studio uses 1.8 (I can see that in the about popup).

I want to change the JVM used for running Android Studio to 1.7, since I have some performance problems and I suspect it has to do something with using JRE 1.8.

What is the proper way to do that?

like image 425
Ran Avatar asked Apr 26 '15 13:04

Ran


People also ask

How do I change the default Java 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.

Is JRE required for Android Studio?

Android Studio is a customized version of JetBrains' IntelliJ IDE, which is, in turn, a Java application. Therefore, as we established, to launch IntelliJ (and, consequently, Android Studio) on your computer, you need to have JRE installed.

Can I use Java 17 for Android Studio?

As per the docs, JDK 17 isn't supported yet in Android Studio.

Which version of Java is used in Android Studio?

Android Studio supports all the same programming languages of IntelliJ (and CLion) e.g. Java, C++, and more with extensions, such as Go; and Android Studio 3.0 or later supports Kotlin and "all Java 7 language features and a subset of Java 8 language features that vary by platform version." External projects backport ...


1 Answers

This answer here solves your problem:

https://stackoverflow.com/a/27999642/4114992

In particular, the start script states:

# ---------------------------------------------------------------------
# Locate a JDK installation directory which will be used to run the IDE.
# Try (in order): STUDIO_JDK, JDK_HOME, JAVA_HOME, "java" in PATH
# ---------------------------------------------------------------------

So, if you set STUDIO_JDK as an environment variable, to, say, 1.7, you should be able to override the JRE used by Android Studio itself.

like image 142
Donald_W Avatar answered Oct 02 '22 00:10

Donald_W