Error Message: Can’t determine a valid Java Home

You have to do a few things:

  • define a new variable JAVA_HOME and assign to it exactly JDK installation location, like C:\java\jdk_1.8.0
  • update your Path variable with:

%JAVA_HOME%\bin

  • important point set it first to Path.
    Finally, your Path will look:

%JAVA_HOME%\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows

java -version

The output should be something like:

java version "1.8.0_192"
Java(TM) SE Runtime Environment (build 1.8.0_192-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

BTW your Path has some duplication. Just remove an unneeded part.

Leave a Comment