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.
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".
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.
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.
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.
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.
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 :)