Search code examples
javaandroidandroid-studiojava-home

Problems setting the JAVA_HOME variable


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.


Solution

  • 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.