Reputation: 1648
I'm struggling with Java installation on my Windows 10 machine. If I look at my JAVA_HOME the path is set for Java 13, but when I type in java -version I get a Java 8 as result. What am I doing wrong?
EDIT: I added the JAVA_HOME to my user variables, to my user PATH and it is already inside the regular PATH, still no change, even after rebooting the machine.
Is it possible that the first and third entry of my system PATH is part of the problem? These folders point to a JAVA 8 java.exe.
Upvotes: 0
Views: 1734
Reputation: 1
I also had the same issue. But I reoder the path. Just set the first entry(C:\Program Files (x86)\Common Files\Oracle\Java\javapath) in the provided image before the "%JAVA_HOME&\bin" Entry. Aftet that it worked in my case.
Upvotes: 0
Reputation: 279
Java looks at what is in the PATH Environment Variable, so inside of that variable, you need to paste in the same path that you put into the JAVA_HOME variable. That way the java will be updated to whatever jdk version you are using in the PATH variable. If you want, you can also erase the older jdk from the PATH, so that there are no ambiguities in the version of java that you are using.
Upvotes: 2
Reputation: 26
Plase check the PATH variable, both user and system, you'll find a reference to the java 1.8.0_221 installation.
You also could add as the fisrt PATH entry %JAVA_HOME%/bin in order to use the JAVA_HOME refeered JDK
Upvotes: 1
Reputation: 2277
You did not set your path for the latest Java version. Copy the value that you have in your JAVA_HOME, and paste it in your PATH (top of your window).
Upvotes: 1