Reputation: 4263
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.
However, the file path does exist:
And in my Environment Variables, I have set JAVA_HOME
to that location:
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:
Any help on how I could resolve this? My last resort is uninstalling and reinstalling IntelliJ, which I may have to do.
Upvotes: 20
Views: 56847
Reputation: 11
I got the same issue when I launched IDEA Community Edition 2020.3.3. After trying several solutions provided in this post, the issue persists. I finally fixed this issue by:
Upvotes: 1
Reputation: 1
In my case, it was because the JAVA_HOME
I set was inconsistent with the Java version started by PyCharm by default.
Upvotes: 0
Reputation: 938
Since this question appeared in my google search, and none of the aforementioned answers worked for me - here is my resolution.
What worked for me was changing \
to /
in path.
So in my case it was:
C:/Program Files/Java/jdk-11.0.11/
:)
Upvotes: 0
Reputation: 5759
The problem I had seemed to be due to attempting to launch idea.exe rather than idea64.exe - when I moved to the 64 one then it worked.
Upvotes: 0
Reputation: 1
You can also change the installation of OpenJDK (if you still have the installer packages) and add the JAVA_HOME variable (you have to enable it), afterwards just click through the installation until it is finished.
Upvotes: -1
Reputation: 11
Had the same issues opening PHPSTORM from command line. Solution was to download jdk version 8 x86(32bit). Edit settings in Environment Variables by setting JAVA_HOME path in user variables for... to C:\Program Files (x86)\Java\jdk1.8.0_221
Upvotes: 1
Reputation: 8645
My problem was adding 2 path in JAVA_HOME variable (I had added x64 jdk path with x86 jdk and my android studio needed just the x86 one. I deleted the x64 path and it has just worked :)
Upvotes: 0
Reputation: 735
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.
Upvotes: 16
Reputation: 582
I faced the same issue.. My mistake was I was taking the path till /bin/ and putting ; at last.
Correct is - JAVA_HOME=C:\Program Files\Java\jdk1.8.0_92
no /bin/ no ';'
Upvotes: 1
Reputation: 9
Open a CMD window, and enter:
echo %JAVA_HOME%
Verify the result is indeed the path entered your JAVA_HOME
variable,
i.e. C:\Program Files\Java\jdk1.8.0_74
.
In my case, a space was slipped in, that was not visible in the Envrironment Variables window.
Upvotes: 0
Reputation: 6503
The problem will almost certainly be with the quotation marks around your JAVA_HOME path. Remove those and see if it works. If not, then I would recommend only putting your JDK installations under the root and with no spaces in them. I tend to put them in C:\JDK\1.8.0_65
, etc. It makes referencing them far easier and you don't have to worry about quotation marks to protect spaces like you do with "Program Files".
Upvotes: 3
Reputation: 3914
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%
.
Upvotes: 13