How do I run Android Studio with a newer JRE or JDK on the mac?

后端 未结 2 2106
北恋
北恋 2021-01-22 05:37

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 (whic

2条回答
  •  长情又很酷
    2021-01-22 05:47

    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.

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

    java version "13.0.1" 2019-10-15
    Java(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/ on macOS (~/Library/Preferences/AndroidStudio3.5 in my case).

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

提交回复
热议问题