Problems setting the JAVA_HOME variable
Asked Answered
K

7

4

So I just downloaded Android Studio, and am trying to set the JAVA_HOME variable so I can run it. I'm using windows 8 and have followed all the instructions I've been able to find to no avail... went to advanced system settings > environment variables and then set the JAVA_HOME variable with the value containing my path to jre7. I've double checked the path a million times, I don't see anything wrong with it(C:\Program Files (x86)\Java\jre7). I know the variable name is right, and I know that windows is excepting the variable, I've even restarted twice. What am I doing wrong here? The only thing I can think of that may be wrong is the fact that I'm pointing to a jre instead of a jdk, but I've always thought that both worked... anyway, the exact error message I get when I try to open Android Studio says:

No JVM installation found. Please install a 64-bit JDK. If you already have a JDK installed, define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.

If a jre doesn't work in place of a jdk, then how do I go about getting one? I know nothing about Java I just want to get into this IDE and play around with Android.

Khalif answered 25/11, 2013 at 22:22 Comment(1)
Download a JDK; how to do so is trivially searchable. If you know "nothing about Java" then "playing around" with Android will be... interesting.Cavour
L
3

No JVM installation found. Please install a 64-bit JDK.

It's asking for a 64-bit JDK. You say your environment variable is pointing at the following directory:

C:\Program Files (x86)\Java\jre7

There's two things wrong here. First, you're pointing to a JRE - Java Runtime Environment. This is not a JDK - Java Development Kit. The JRE is for running Java applications; the JDK is for developing Java applications. There's a significant difference there.

Secondly, as others have mentioned, you're pointing the environment variable to the 32-bit version. You need a 64-bit JDK. This will be installed at C:\Program Files\Java\jdk1.7.0_XX or similar, by default.

You can acquire a JDK installation from Oracle.

Lowney answered 25/11, 2013 at 22:37 Comment(0)
I
3

Here is the official installation instructions - http://docs.oracle.com/javase/7/docs/webnotes/install/windows/jdk-installation-windows.html

The important thing is

  1. Set JAVA_HOME to the location where jre or jdk is installed

  2. Add %JAVA_HOME%/bin to your path variable.

Make sure you add these to "System Variables" and not in "User variables for xxx"

Iinden answered 25/11, 2013 at 22:49 Comment(0)
S
1

By default, c:\Program Files (x86) (environment variable ProgramFiles(x86))is used for 32-bit installations. 64-bit installations use c:\Program Files (environment variable ProgramFiles).

When I open a cmd box on my Windows 7 64-bit, I can issue the "set" command to get

ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files

This should be similar under Windows 8.

Spiceberry answered 25/11, 2013 at 22:33 Comment(0)
W
1

Try runing Android Studio as administrator after setting the JAVA_HOME variable! It worked for me...

Weaver answered 10/11, 2014 at 10:50 Comment(0)
E
0
No JVM installation found. Please install a 64-bit JDK

This is looking for a 64bit version of the java JDK.

C:\Program Files (x86) is the x86 not 64bit.

Click the link below and make sure to download the x64 version.

Java SE Development Kit 7 Downloads

Then the folder path should be

C:\Program Files\Java\jre7
Eddieeddina answered 25/11, 2013 at 22:30 Comment(0)
F
0

Same thing happened to me and it turns out that all I had to do was unblock the file. Go to the file properties and at the bottom where it tells you it's from another computer and is blocked, just unblock it. This may not be true for everyone but it probably is if the path code is exactly what it should be and still isn't working.

Fredette answered 14/1, 2015 at 1:37 Comment(0)
A
0

the solution is simple,

I think your java path contains /bin

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

just path to the folder of JDK

like C:\Program Files\Java\jdk1.8.0_181

don't forget to restart your IDE or Code Editor

Anchovy answered 21/9, 2019 at 23:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.