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 :)

6 comments:

  1. you need to execute 'lauchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk' only once

    ReplyDelete
  2. worked for me!!!!!!! thanksssss!!!

    ReplyDelete
  3. Worked for me too. Thanks :)

    ReplyDelete
  4. It worked for me as well. Thanks!

    ReplyDelete
  5. I have installed the latest version of Java for osx but my Javavirtualmachines folder is empty. How can I correct this? Thanks!!

    ReplyDelete
    Replies
    1. Hi mick, have you managed to solve the trouble? did you install the latest update from Apple or from Oracle? In my case, I am using java from www.java.com.

      Delete