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


当前回答

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

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

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

其他回答

把这个家伙装在这里

http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US

你应该很好。

安装最新的JDK (8u102 current) 设置环境变量STUDIO_JDK (java_home输出Java主目录,sed剥离两个文件夹以获得jdk目录) /usr/libexec/java_home -version 1.8 | sed 's/\/Contents\/Home//g' ' 像往常一样启动Android Studio

在每次重启时设置STUDIO_JDK

以上步骤仅适用于当前会话。下面是如何在/Library/LaunchDaemons中创建一个plist文件,在每次引导时运行上面的命令:

sudo defaults write /Library/LaunchDaemons/com.google.studiojdk Label STUDIO_JDK
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk ProgramArguments -array /bin/launchctl setenv STUDIO_JDK `/usr/libexec/java_home | sed 's/\/Contents\/Home//g'`
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk RunAtLoad -bool TRUE

要知道plist的诀窍,请访问http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-launchd-plist/

不要编辑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.

我也在处理同样的问题,而且我成功了。

可能是JDK版本不对。

现在我安装了jdk1.8,现在没问题了。

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

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

不编辑信息。plist必要!