Pages

Friday, December 19, 2014

Android Studio was unable to find a valid JVM

I obtained the following message when opening Android Studio 1.0.1 on Mac OSX Yosemite:
Android Studio was unable to find a valid JVM
Among some workarounds for the problem that I found in this Stackoverflow thread, I think the simplest one is by creating a small bash script that export the environment variable for the JVM and launch the Android Studio. For example, in my machine the JVM is located at /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk, so the script looks like this:
#!/bin/bash export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk open /Applications/Android\ Studio.app


That's all :)