简体   繁体   中英

How to choose Java version for Android Studio

I downloaded Android Studio latest version and installed Java 8. When I launch Android Studio I got below image.

在此输入图像描述

Android studio found my Java version is 1.6 which is deprecate to run it. But I have installed java 1.8.0_101 and set the JAVA_HOME correctly. Please see below terminal output:

zhaoyi0113:Contents zhaoyi0113$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
zhaoyi0113:Contents zhaoyi0113$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

I wonder how to setup java version for android studio?

EDIT1

I have tried to reboot my mac os but it still got the same error.

EDIT2

This dialog block me using android studio so there is no chance for me to click android studio menu or doing any configuration on it. When I click the update button, my browser will be open to jdk1.6 download page.

转到File > Project Structure然后选择正确的SDK和JDK位置。

you must edit Info.plist : to right click on the icon for the Android application Studio and choose " Show Package Contents "

Open Contents/Info.plist with a TextEdit, at the line :

<key>JVMVersion</key>
  <string>1.6</string>

, changes in

<key>JVMVersion</key>
  <string>1.7*,1.8+</string>

Sorry for my very bad english !

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM