Android Studio on Mac OSX Yosemite
I recently migrated to Mac OSX Yosemite and discovered that when I booted Android Studio I could not start it up since a JVM was not found on the machine. I was running 1.0RC3 version of Android Studio, and did not have this problem before, on Mavericks. I knew I had a JVM installed.
I did some search and stumbled upon this thread on stackoverflow. From RC3 onwards Android Studio requires a
STUDIO_JDK environment variable to be able to run correctly. I found the resulting applescript as discussed in the answer a bit of an overkill. Here’s what I did:
/etc/launchd.conf on your mac using the terminal and add these lines (
launchd.conf might not exist on your machine):
The correct version of Java will depend upon the version of Java installed in your machine. Be sure to find out the correct version of Java before making the change.
Now open your
~/.bashrc file and add the following lines:
This will set the correct environment variable during startup. And you can continue to launch Android Studio properly. To see immediate effect, type
source ~/.bashrc in your terminal to refresh the environment variables.