IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid

In my case the answers above didn't work. Here's what work for me: I needed to change Gradle JVM to point to the actual JDK: Image showing IntelliJ Settings window


IDEA comes in 2 versions: 32bit and 64bit.

Your JAVA_HOME is 64bit version of Java so you have to run 64bit version of the IDEA ...\IntelliJ\IntelliJ IDEA Community Edition 14.1.2\bin\idea64.exe.

Otherwise, you can provide 32bit JDK or tweak the behaviour with IDEA settings https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under