The JAVA_HOME issue seems to be a problem that has affected many. Therefore, I decided to take the time to lay down everything you need to do to fix your problems completely.
“Error launching Android Studio: The environment variable JAVA_HOME (…) does not point to a valid JVM installation.”
If you intend to develop Android apps, you will need the Java Development Kit (JDK). Do not confuse with the Java Runtime Environment (JRE). If you download and install the JDK, you get the JRE as well.
To download the Java Development Kit, head to http://www.oracle.com/technetwork/java/javase/downloads/index.html and make sure you click download for the JDK.
To check if you already have the JDK installed, do the following:
- In a command prompt (Windows Key + R, then type cmd), type:
If the command prompt complains that javac is not found, it is possible that the bin folder, where all the java binaries are located, is not in your system path ($PATH). What you can do is check the following folders:
64-bit: C:\Program Files\Java
32-bit: C:\Program Files (x86)\Java
and see if you have any jdk1.x.x_xx folders.
I recommend that you install the 64-bit JDK on a 64-bit machine.
Alright, once you have the latest JDK installed, we need to set the JAVA_HOME variable. On Windows 8, press the windows key and search for “View advanced system settings”. Alternately, you may right click on My Computer(or ‘This PC’ in explorer)>Properties>Advanced system settings.
Navigate your way to the Environment variables: Advanced Tab>Environment Variables
In the User variables section, check if you have a JAVA_HOME variable already set. If not, create one and set the path to the root of your JDK. For instance, if you installed the 64-bit JDK 8 Update 45 version, the root folder will be:
Set the JAVA_HOME to the root folder as per your installation.
Click OK, leave all configuration screens and open Android Studio.
You are welcome