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

18

67

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
Murphey answered 14/1, 2014 at 16:45 Comment(2)
have you restarted your system after setting the JAVA_HOME ??Evetta
I really hope those 'GOOGLE ENGINEERS' developing on AS should at least make the IDE run and have us set the JDK ourselves. This is very annoying that it just blocks you from start. If that is not possible then have a GUI popup during loading that asks us for valid JDK env variable. I am perplexed why they missed out on this. This is unacceptable. So basic.Telegraphone
W
197

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.

Wiedmann answered 6/6, 2014 at 9:3 Comment(9)
Thanks, so the trick was to remove bin from the path, i did not try with bin\javaw.exe before. All the documentation tells you to include the bin folder... shame on them, well good tip :)Harmonia
For me it only worked when I used C:\Program Files\Java\jdk1.8.0_xx where "xx" is the update number without the \; at the endEldoneldora
Also important: do not sourround the path in quotes "C:/Pro...". That might be obvious for some, but unfortunately not for me.Episcopal
Did require a boot too.Treasurehouse
For me its worked only after removing the semi colon ";" at the end of the path...Novosibirsk
It shouldn't be the bin folder, but the root as pointed out in the answer!Matrix
Oddly enough, it worked for me when I changed the user variablePandurate
This pointed towards the right direction. Also, I had to remove all the double quotes etc from the path and put it in system pathTyrontyrone
In my case, I have to remove the bin folder from JAVA_HOMEReichard
I
53

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
Intrauterine answered 31/12, 2014 at 19:8 Comment(0)
U
28

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.

Uninterested answered 12/5, 2015 at 18:15 Comment(2)
its really a magic, don't know why they not support JAVA_HOME for setting environment variable. But its done with JDK_HOMEHumiliating
After an Android Studio update, same problem, same perfect solution.Annalee
M
21

2 suggested solutions

  1. Upgrade JDK to 1.7

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

Menu answered 14/1, 2014 at 16:51 Comment(4)
i had download 1.8 install it giving path to jdk1.8/bin now it giving me this errorTalbert
with the version 1.8.0_25 i'm still getting the error!Smaragd
Check it in your command line tool by typing "Java --version"Beanie
I also had the similar error with JDK 1.8 64 bit installed, i remove JAVA_HOME variable from environments and wrote JRE and JDK path in PATH variable C:\Program Files\Java\jre1.8.0_65\bin;C:\Program Files\Java\jdk1.8.0_65\bin, now android studio is working fine, it automatically picked up the JVM Path. hope this will help someoneEmelun
G
14

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!

Galateah answered 22/1, 2015 at 19:9 Comment(0)
C
10

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.

Caffrey answered 4/5, 2015 at 20:22 Comment(0)
S
2

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)

Sill answered 16/11, 2015 at 4:8 Comment(0)
F
2

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\

Faenza answered 30/11, 2015 at 21:46 Comment(0)
G
1

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.

Gasman answered 19/2, 2015 at 7:39 Comment(1)
Last step helped me! I just had to remove "\bin" from my JAVA_HOME variable.Caffrey
V
1

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

Valley answered 28/2, 2015 at 17:58 Comment(0)
A
1

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.

Argentinaargentine answered 23/4, 2015 at 21:56 Comment(0)
M
1

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

Metempirics answered 9/5, 2015 at 6:10 Comment(1)
This was my problem too. I removed the quotes and that solved itHyssop
P
1

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

Paction answered 29/5, 2015 at 19:42 Comment(0)
W
1

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

Wingover answered 31/10, 2015 at 10:34 Comment(0)
B
1

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.

Belier answered 24/4, 2016 at 12:24 Comment(0)
S
0

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

Sudoriferous answered 11/11, 2014 at 7:56 Comment(0)
C
0

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

enter image description here

Chit answered 1/9, 2015 at 16:30 Comment(0)
Z
0

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.
Zeal answered 19/4, 2016 at 3:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.