我无法在Mac OS上启动我的Android Studio进行Android开发(10.10.1 - Yosemite)


当前回答

AndroidStudio将从文件~/Library/Preferences/AndroidStudio/idea.properties中读取设置。我创建了这个文件,其中有我的jdk的路径:

STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk

不编辑信息。plist必要!

其他回答

正如@Gerard的建议,我总结了我的原始评论(https://stackoverflow.com/a/27370525/763459)作为答案,希望它能帮助其他被这个问题困扰的人。

有一种不运行AppleScript的方法: 编辑.bash_profile(如果这个文件不存在,请创建一个新的文件,就像@Gerard建议的那样,你可以第一次使用源文件.bash_profile)。

安装遗留Java(可能需要)http://support.apple.com/kb/DL1572 输入export STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk 然后退出终端(或任何你用来编辑这个文件的文本编辑器),运行Android Studio和viola

在OSX 10.10和Android 1.0.1上测试

我也有同样的问题,用这种方式解决:

你应该从苹果官方页面安装Java。

http://support.apple.com/kb/DL1572

在Mac OS X Yosemite上只需安装:

Java SE开发工具包8

and

Java Version 8 Update 25

这都是我的工作!就像gehev说的,这么简单!

不要编辑plist。这些说明在我几个月前第一次安装Android Studio时起了作用,就在今天。(1/21/2015)

你所需要做的只是几件简单的事情,尽管谷歌的网站上并没有列出。

First you need Java installed. this is not the JDK, it is seperate. You can get that from this link. If you don't have this it will probably throw an error saying something like "no JVM installed." Second you need the Java JDK, I got JDK 7 from this link. Make sure to choose the Mac OS X link under the Java SE Development Kit 7u75 heading. If you don't have this it will probably throw an error saying something like "no JDK installed." If you haven't already installed Android Studio, do that. But I'm sure you've already done that by now.

注意,最后一个变量允许你在OSX上运行带有Java 7的Android Studio(通常从Info.plist中指定的版本中选择Java 6):

$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk

$ open /Applications/Android\ Studio.app

为我工作