For someone has already put "JAVA_HOME" in variables-environment and displayed the path by "echo %JAVA_HOME%" then the result would be your jdk-dir but "java -version" does not work globally. Then try :
set PATH=your-jdk-dir\bin;%PATH%
If it works ,your Windows picked up the Path incorrectly.