Android Studio 无法在 Mac OSX(小牛队)上加载 JVM [英] Android Studio failed to load JVM on Mac OSX (Mavericks)

查看:73
本文介绍了Android Studio 无法在 Mac OSX(小牛队)上加载 JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Mac 上设置 Android Studio.它运行的是 OSX 10.9.1 Mavericks.我已经安装了最新的 JDK(在撰写 1.7 更新 45 时),并且我安装了 Android Studio.我使用 Java 7,因为我必须运行一些 Java 应用程序,它们需要 1.7.我没有安装Java 1.6,因为它是古老而古老的.从任何启动器启动 Android Studio 几乎没有任何作用.活动管理器从不显示它正在运行.我不想安装 Java 1.6.

我做了一些工作并尝试通过命令行通过包内容运行可执行文件,对于这两个可执行文件,我收到以下消息:

我不确定我应该怎么做才能解决这个错误.我在 Mac 上不是很熟练(对它还是有些陌生,并且在这方面做高级用户的东西很令人困惑)所以如果有人能帮我弄清楚那会很棒.我在 2013 年的 Macbook Air 上有足够的资源可以运行.

更新:这也适用于 Yosemite、El Capitan 和所有其他可以运行 Android Studio 的 OSX 版本.

解决方案

更新 12/11/2014从 Android Studio 1.0 RC3 开始,您可以按照

要打开包,您需要在 Applications 文件夹中找到 Android Studio.app 文件,然后右键单击它 > Show Package Contents.

编辑 plist(我认为您可能需要成为 root 用户)并将 JVMVersion 从 1.6* 更改为 1.7*(或 1.8*,或您拥有的任何 JDK 主要版本).我不明白为什么这会有所不同,因为我的原始输出说它无论如何都使用 1.7.

此修复似乎适用于 IntelliJ 的所有 IDE(我也在 PyCharm 上看到过),尽管其他似乎原生支持较新版本的 Java.

I am trying to setup Android Studio on my Mac. It is running OSX 10.9.1 Mavericks. I have installed the latest JDK (at the time of writing 1.7 update 45), and I installed Android Studio. I use Java 7 because I have some Java applications I have to run and they require 1.7. I have not installed Java 1.6, because it is ancient and old. Launching Android Studio from any launcher does literally nothing. Activity Manager never shows it running. I do not want to install Java 1.6.

I did some work and tried to run the executable via command line through the package contents, and for both executables, I get these messages:

I am unsure what I am supposed to do to fix this error. I'm not very adept on a Mac (still somewhat new to it, and its confusing to do power user stuff on this) so if anyone can help me figure it out that'd be great. I'm on the 2013 Macbook Air with plenty of resources for this to run.

Update: This also applies to Yosemite, El Capitan, and all the other versions of OSX that can run Android Studio.

解决方案

Update 12/11/2014 As of Android Studio 1.0 RC3 you can follow this set of directions to make it work.

I figured it out. You have to edit the android studio's Info.plist file in the package so it uses 1.7. I don't get why Android Studio insists we install and use an outdated, vulnerable version of Java.

Full resolution: http://i.stack.imgur.com/yyYaG.png

To open the package you need to find the Android Studio.app file in the Applications folder and right click it > Show Package Contents.

Edit the plist (I think you might need to be root) and change JVMVersion from 1.6* to 1.7* (or 1.8*, or whatever JDK major version you have). I don't get why that made a difference since my original output said it was using 1.7 anyways.

This fix seems to apply to all of IntelliJ's IDEs (I've seen it on PyCharm as well), though other ones seem to support newer versions of java natively.

这篇关于Android Studio 无法在 Mac OSX(小牛队)上加载 JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆