Installing Android Studio, does not point to a valid JVM installation error

JavaAndroidJvmEnvironment VariablesJava Home

Java Problem Overview


I just downloaded the Android Studio. While trying to run it, I had to modify the environment variable and add

> JAVA_HOME

and

> C:\Progra~2\Java\jdk1.6.0_22

Once I finished that hurdle, now I am receiving another error:

The environment variable JAVA_HOME (with the value of *C:\Progra~2\Java\jdk1.6.0_22*) does not point to a valid JVM installation.

I looked through other similar questions and I was asked to check the version, so I did the following in CMD:

C:\Users\Andre>java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)

C:\Users\Andre>javac -version
javac 1.6.0_22

From the results it seems like I have JVM.

I also tried these paths for JAVA_HOME, I closed and reopened a new CMD window each time

C:\Program Files (x86)\Java\jre7
C:\Program Files (x86)\Java\jre6
C:\Program Files (x86)\Java\jdk1.6.0_22
C:\Program Files (x86)\Java\jre7\bin
C:\Program Files (x86)\Java\jre6\bin
C:\Program Files (x86)\Java\jdk1.6.0_22\bin

Java Solutions


Solution 1 - Java

Point your JAVA_HOME variable to C:\Program Files\Java\jdk1.8.0_xx\ where "xx" is the update number (make sure this matches your actual directory name). Do not include bin\javaw.exe in the pathname.

NOTE: You can access the Environment Variables GUI from the CLI by entering rundll32 sysdm.cpl,EditEnvironmentVariables. Be sure to put the 'JAVA_HOME' path variable in the System variables rather than the user variables. If the path variable is in User the Android Studio will not find the path.

Solution 2 - Java

It is absolutely possible that all other answers work for people but for me this path worked:

Leave your JDK path under JAVA_HOME System Variable as it is given here. Do not append bin or another path. It worked for me.

C:\Program Files\Java\jdk1.8.0_11\

Otherwise I am getting this error:

Installing Android Studio, does not point to a valid JVM installation error

Solution 3 - Java

Updated android studio to 1.2.1. Even though I was getting the same error. Nothing worked, finally replaced JAVA_HOME with JDK_HOME and it did the magic.

Solution 4 - Java

2 suggested solutions

  1. Upgrade JDK to 1.7

  2. Make sure the 32-bit or 64 bit versions match on both sides

Solution 5 - Java

Recently I am working with the 1.8.0_25 JDK version on Windows 8.1 and I had the same problem with this. But as PankaJ Jakhar said

The real solution for me was pretty simple:

  1. Add the JAVA_HOME variable to the system ones, not on the user ones.

  2. The path I introduced for this variable was:

    C:\Program Files\Java\jdk1.8.0_25\
    

And it works for me!

Solution 6 - Java

In my case, it started hapenning after I updated to Android Studio 1.2. To fix it I just had to remove "\bin" from my JAVA_HOME variable.

Solution 7 - Java

  1. Just remove \bin from Java_home environmental Variable. This worked for me .
  2. Also make sure you are using the correct versions of android studio and Java (32/64 bit)

Solution 8 - Java

I had to put backslash at the end of path and it worked for me.

Earlier I was using

> C:\Program Files\Java\jdk1.7.0_79

just by putting "" at the end, worked for me. Now the value of the JAVA_HOME variable is

> C:\Program Files\Java\jdk1.7.0_79\

Solution 9 - Java

I am using 64-bit Windows. After battling with various settings I followed these steps:

  • Thru Add/Remove Programs I uninstalled all Java(s)
  • Removed JAVA_HOME variable from environment
  • Removed Java folder reference from PATH environment variable
  • Downloaded and installed 64-bit Java SDK
  • Added JAVA_HOME variable in system variables and assigned it the value C:\Program Files\Java\jdk1.8.0_31

In the last step please note that its the parent Folder and not the \bin sub-folder. It started working.

Solution 10 - Java

Don't include bin folder while coping the path for Java_home.

Solution 11 - Java

I had this problem as well, and I must have tried 20 different path adding solutions before I worked it out. Someone mentioned it above almost as a side note, but this was exactly my issue:

make sure you are running a 64-bit version of java.

Solution 12 - Java

My problem was different to any of the above as far as I can tell. I had a working version 1.1 of Android Studio and upgraded to 1.2 Then I got the JAVA_HOME error when starting 1.2

The problem was that my JAVA_HOME was set to "C:\Program Files\Java\jdk1.8.0_20" with quotation marks included. I haven't put them there to quote the string, the quotation marks were in the Variable Value field. It appears that 1.1 is happy with the quotes being there but 1.2 is not.

Removing quotes removed the error and 1.2 now opens fine

Solution 13 - Java

Try using the above options But this one worked for me. my JAVA_HOME looked like this C:\Program Files\Java\jdk1.7.0_21;F:\Software\apache-ant-1.9.4-bin\apache-ant-1.9.4\bin Only keeping the JAVA path in the JAVA_HOME Remove any additional path if you had given C:\Program Files\Java\jdk1.7.0_21

Solution 14 - Java

i think you are doing every thing fine just remove ";" from the last of java_home variable. every thing will work fine.

Solution 15 - Java

Using c:/Program Files/Java/jre1.8.0_73/ instead of C:/Program Files/Java/jdk1.8.0_73 as JAVA_HOME variable solved the problem for me. Android studio now launches without problems.

Solution 16 - Java

Follow @abs solution

If you still continue to get the error even after setting the JAVA_HOME variable Copy the studio folder to your C drive and then run the studio.exe or studio64.exe depending upon your java versio

Solution 17 - Java

In my case it was because of an invisible character at the beginning of the path:

enter image description here

Solution 18 - Java

Most probably the issue happens because of the incompatability of 32 bit and 64 bit excecutables. Suppose if you have installed 32 bit Android Studio by mistake and you will be downloading a 64 bit JDK. In this case 32 bit Android Studio will not be able to pick up the 64 bit JDK. This was the issue I faced. So I followed the below simple steps to make it working,

  1. Downloaded 32 bit JDK(you can also download 64 bit Android Studio if you do not want to change the 64 bit JDK)
  2. Right click MyComputer > Advanced System Settings > under 'Advanced tab' > Environment variables > Under System Variables > Add JAVA_HOME as key and your jdk(eg:C:\Program Files (x86)\Java\jdk1.7.0_79) location as value.
  3. Save it and launch Android Studio. You are good to go now.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLegionDevView Question on Stackoverflow
Solution 1 - JavaEdwin MokamiView Answer on Stackoverflow
Solution 2 - JavaMasterView Answer on Stackoverflow
Solution 3 - JavaPK GuptaView Answer on Stackoverflow
Solution 4 - JavaAbsView Answer on Stackoverflow
Solution 5 - JavaalexventuraioView Answer on Stackoverflow
Solution 6 - JavaRodrigo VenancioView Answer on Stackoverflow
Solution 7 - JavaBharadwaj_TurlapatiView Answer on Stackoverflow
Solution 8 - JavaKartik GoyalView Answer on Stackoverflow
Solution 9 - JavaAnRView Answer on Stackoverflow
Solution 10 - JavaRahul SononeView Answer on Stackoverflow
Solution 11 - JavaJared SanchezView Answer on Stackoverflow
Solution 12 - JavaKevanView Answer on Stackoverflow
Solution 13 - JavaKaustubh RaoView Answer on Stackoverflow
Solution 14 - JavaAMITView Answer on Stackoverflow
Solution 15 - JavaBbbarttView Answer on Stackoverflow
Solution 16 - JavaSagar DevangaView Answer on Stackoverflow
Solution 17 - JavaAngelo TricaricoView Answer on Stackoverflow
Solution 18 - JavadreamdeveloperView Answer on Stackoverflow