我无法在Mac OS上启动我的Android Studio进行Android开发(10.10.1 - Yosemite)
当前回答
在Mac OS X Yosemite上只需安装:
Java SE开发工具包8
and
Java Version 8 Update 25
这都是我的工作!就像gehev说的,这么简单!
其他回答
对于那些在创建启动时启动的脚本时遇到困难的人,作为替代方案,你可以将这个.plist添加到你的LaunchAgents文件夹中。这可能是向系统中添加环境变量的更合适的方式,因为Yosemite决定取消launchd.conf。由于LaunchAgents文件夹的性质,这应该也适用于用户帐户,但我还没有测试。
要做到这一点,创建一个.plist文件,具有以下名称和路径:
/Library/LaunchAgents/setenv.STUDIO_JDK.plist
内容:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>setenv.STUDIO_JDK</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>
launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceIPC</key>
<false/>
<key>LaunchOnlyOnce</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
然后在终端中执行以下命令更改文件属性:
sudo chmod 644 /Library/LaunchAgents/setenv.STUDIO_JDK.plist
sudo chown root /Library/LaunchAgents/setenv.STUDIO_JDK.plist
sudo chgrp wheel /Library/LaunchAgents/setenv.STUDIO_JDK.plist
注:
1)您可能需要更改'jdk1.8.0_25。Jdk '以匹配您的计算机上的版本。
2)我尝试使用“jdk1.8.*”。jdk”来尝试和解释不同的Java *版本,但当我打开Android Studio时,我得到了no JVM错误,即使你运行“echo $STUDIO_JDK”它返回正确的路径。也许有人对如何解决这个问题有一些见解。
把这个家伙装在这里
http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US
你应该很好。
我也在处理同样的问题,而且我成功了。
可能是JDK版本不对。
现在我安装了jdk1.8,现在没问题了。
编辑android工作室的信息。plist文件,以便它使用1.7或任何您已经安装的JVMVersion。将JVMVersion更改为1.6+而不是如上所述的hassternet回答的1.6*应该也可以工作。
上述工作,但不建议参阅RC3发行说明
As of RC 3, we have a better mechanism for customizing properties for the launchers on all three platforms. You should not edit any files in the IDE installation directory. Instead, you can customize the attributes by creating your own .properties or .vmoptions files in the following directories. (This has been possible on some platforms before, but it required you to copy and change the entire contents of the files. With the latest changes these properties are now additive instead such that you can set just the attributes you care about, and the rest will use the defaults from the IDE installation).
Android Studio无法在Mac OSX上加载JVM (Mavericks)
在Mac OS X Yosemite上只需安装:
Java SE开发工具包8
and
Java Version 8 Update 25
这都是我的工作!就像gehev说的,这么简单!
推荐文章
- 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
- 安装APK时出现错误
- 在流中使用Java 8 foreach循环移动到下一项
- 访问限制:'Application'类型不是API(必需库rt.jar的限制)
- 用Java计算两个日期之间的天数
- 为什么在Mac OS X v10.9 (Mavericks)的终端中apt-get功能不起作用?
- 碎片中的onCreateOptionsMenu
- 如何配置slf4j-simple
- 在Jar文件中运行类
- 带参数的可运行?
- TextView粗体通过XML文件?
- 如何使线性布局的孩子之间的空间?
- 我如何得到一个字符串的前n个字符而不检查大小或出界?
- 我可以在Java中设置enum起始值吗?
- Java中的回调函数