4

I tried to install java 14 manually on Windows 10. I set the System Variables as in this picture.

But when I use the command "java -version" literally nothing happens...

C:\WINDOWS\system32>java -version

C:\WINDOWS\system32>

Something must be wrong, but I can't figure what...

akuzminykh
  • 4,522
  • 4
  • 15
  • 36
Gesichtsfelsen
  • 59
  • 1
  • 1
  • 7

2 Answers2

15
  1. Move C:\Program Files\Java\jdk-14.0.2\bin\java to the beginning in the PATH variable.
  2. Important - Open a new cmd window and use the command java -version. Any already open cmd windows do not reflect the settings that you do in the environment variables form/window.
Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
6

Solution

Please first run the following command

"c:\Program Files\Java\jdk-14.0.2\bin\java" --version

If that returns a result remove the following entries from your PATH

c:\Program Files\Common Files\Oracle\Java\javapath
c:\Program Files\Java\jdk-14.0.2\bin\java\bin

Then create an environment variable called JAVA and set it to %JAVA_HOME%\bin, then simply add %JAVA% to your PATH variable.

You will need to close your command prompt window and reopen it before the change will take effect

Chris Maggiulli
  • 3,375
  • 26
  • 39