Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio failed to load JVM on Mac OSX (Mavericks)

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:

Error message

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.

like image 218
Mgamerz Avatar asked Jan 04 '14 18:01

Mgamerz


People also ask

Is JVM required for Android studio?

Android Studio is a customized version of JetBrains' IntelliJ IDE, which is, in turn, a Java application. Therefore, as we established, to launch IntelliJ (and, consequently, Android Studio) on your computer, you need to have JRE installed.

How do I see JVM path on Mac?

In macOS, the JDK installation path is /Library/Java/JavaVirtualMachines/jdk-10. jdk/Contents/Home . The root directory of the JDK software installation. This directory also contains copyright, README, and src.


1 Answers

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.

Location of file - you need to open it in the Applications folder 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.

like image 139
Mgamerz Avatar answered Sep 18 '22 22:09

Mgamerz