I tried to Upgrade Java on my laptop (running Windows 10) from Java 10 to Java 11. I downloaded and installed the Java 11 SDK from the Oracle website and then I added the address of the bin folder into the Path System Variable and changed JAVA_Home to point to the new jdk file.
Path System Variable looks like this:
....;C:\Program Files\Java\jdk-11.0.1\bin
And JAVA_HOME:
C:\Program Files\Java\jdk-11.0.1
Still, when I open CMD and run: java --version
I get Java 10 although with javac --version
I get Java 11.
I followed the steps described here: How to install OpenJDK 11 on Windows?
With the comment's help and looking at this question I found out that the problem was that the C:\ProgramData\Oracle\Java\javapath
appeared before the Java 11 path, so I moved it to the bottom and now both java
and javac
point correctly to Java 11.
Here's the requested screenshot of the Path variable after I made the change in order:
I upgraded to JDK 11 from JDK 8. After adding Java 11 to the path and JAVA_HOME successfully,
java -version
was still pointing to the previous java version (java 8 in my case.)
Then, I ran a command "setx -m JAVA_HOME "C:\Program Files\Java\jdk-11.0.7"
Now java -version
shows java 11. I hope it helps you too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With