Installed Java 14 but Java -version still showing old Java

Viewed 1038

I have installed java 14 in my system at following location.C:\Program Files\Java\jdk-14.0.1 but on running java -version it is still pointing to java version "1.8.0_251". How do I change that to point to Java 14.

I have set my JAVA_HOME to C:\Program Files\Java\jdk-14.0.1\bin and appended the same to Path of system variables but still it is showing the older version.

Why is it happening, a little help will be deeply appreciated. Thanks

1 Answers

I found the problem, the Path system variable had entries from previously installed java versions. removing them did the trick. Thanks all for helping out with comments.

Related