Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ - Can't start - "JAVA_HOME does not point to a valid JVM installation"

For every other StackOverflow question that's been asked about this, here, here, and here, I've followed all the steps to resolve this issue, and none have worked.

When launching IntelliJ IDEA 64-bit on my 64-bit Windows 7 machine, I encounter the following error:

The environment variable JAVA_HOME (with the value of "C:\Program Files\Java\jdk1.8.0_74") 
does not point to a valid JVM installation.

Error launching IDEA

However, the file path does exist:

Filepath screenshot

And in my Environment Variables, I have set JAVA_HOME to that location:

Environment Variables

I've tinkered around with putting it in my User variables instead of the System and vice-versa, and tried putting it in both. It didn't work with the Java 7 JDK I had originally, so I just downloaded the Java 8 JDK and tried it - no dice.

I also restarted my computer, and CMD can use java and javac with no problem at all:

enter image description here

Any help on how I could resolve this? My last resort is uninstalling and reinstalling IntelliJ, which I may have to do.

like image 866
homersimpson Avatar asked Mar 22 '16 16:03

homersimpson


People also ask

What does not point to a valid JVM?

The environment variable JAVA_HOME does not point to a valid JVM installation. JAVA_HOME should be set to the root of your Java installation. or add this value to the system environment variables. See What are PATH and other environment variables, and how can I set or use them? for more information.

How do you fix please set the JAVA_HOME variable in your environment to match the location of your Java installation?

To set JAVA_HOME, do the following: Right click My Computer and select Properties. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.

Why JAVA_HOME is not working?

Verify JAVA_HOME Enter the command echo %JAVA_HOME% . This should output the path to your Java installation folder. If it doesn't, your JAVA_HOME variable was not set correctly. Please make sure you're using the correct Java installation folder, or repeat the steps above.


2 Answers

In my case, the issue was that JAVA_HOME was pointing to a path upto /bin folder (C:\Program Files (x86)\Java\jdk1.8.0_91\bin\) - while Eclipse accepts this, IntelliJ does not.

Updating to JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_91 resolved the issue.

like image 189
Sachin Lala Avatar answered Sep 18 '22 19:09

Sachin Lala


The java and javac executables are using the PATH environment variable, while intelliJ is using JAVA_HOME variable. Remove the additional quotation marks in your JAVA_HOME value.

It might shows that your path to the jdk installation directory is hard coded in the PATH, rather then using %JAVA_HOME%.

like image 28
Shmulik Klein Avatar answered Sep 20 '22 19:09

Shmulik Klein