Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade to Java 11 on Windows 10

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.

enter image description here

I followed the steps described here: How to install OpenJDK 11 on Windows?

like image 826
Nena Avatar asked Dec 24 '22 03:12

Nena


2 Answers

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: enter image description here

like image 65
Nena Avatar answered Jan 11 '23 05:01

Nena


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.

like image 32
Badri Paudel Avatar answered Jan 11 '23 03:01

Badri Paudel