I have downloaded and installed oraclejdk11 from oracle official site and modified PATH & JAVA_HOME variable in system environment variable on windows
C:\\Users\
I upgraded to JDK 11 from JDK 8. After adding Java 11 to the path [ point path up to
bin foler ] and JAVA_HOME [ only upto jdk folder (don't include bin ) ]
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
or javac -version
both shows java 11.
I hope it helps you too.