Skip to content Skip to sidebar Skip to footer

How Do I Run Android Studio With A Newer Jre Or Jdk On The Mac?

I’m trying to run Android Studio with JDK 13 just because I feel like it must run faster than the JDK 8 that comes embedded with it. According to the documentation (which I found

Solution 1:

TLDR

Don't try to do this. Android Studio 3.5.1 hangs when trying to change the boot jdk. I filed this in the Android Studio issue tracker. Please star it.

Someone privately suggested:

cmd+shift+a -> switch boot jdk

This definitely changed Android Studio's behavior. However, Android Studio 3.5.1 hung at the splash screen.

Android Studio splash screen hangs with different boot jdk

This happened when I tried to start it with either Oracle JDK 13:

java version "13.0.1" 2019-10-15Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

or Oracle JDK 11:

java version "11.0.5" 2019-10-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.5+10-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode)

To fix this problem, I found that Android Studio stores the boot jdk preference in ~/Library/Preferences/<PRODUCT><VERSION> on macOS (~/Library/Preferences/AndroidStudio3.5 in my case).

Then, I simply deleted the studio.jdk file, and Android Studio started normally again.

Solution 2:

Jetbrains has instructions for choosing the underlying runtime.

At a high level:

Install the Choose Runtime plugin

Then do "Find Action" in the IDE and select "Choose Runtime"

Post a Comment for "How Do I Run Android Studio With A Newer Jre Or Jdk On The Mac?"