Eric Francis Eric Francis - 1 year ago 594
Java Question

IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid

Similar to:

- Intellij 14 the supplied javaHome seems to be invalid

- Android Studio - supplied javaHome is not a valid folder

However, I am trying to use my

variable which is set to
C:\Program Files\Java\jdk1.8.0_40

I do not understand why intellij is looking for the JDK inside of its install directory.

In intellij:

Executing external task 'bootRun'...
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1\jre\bin\java.exe
External task execution finished 'bootRun'.

C:\>java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_40

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download