I have installed java 14 before. I have set path variable with java 14 bin folder. But later some day my friend have downloaded JDK 15 and he has saved it inside the java folder(i.e. jdk 14 folder and 15 folder together inside java folder) but he haven't updated the path variable. When I check today the java version from CMD, it says the version is 15, even when i haven't updated the path variable.(Path variable still contains the jdk 14 path) How did this happen? Can someone explain?
Asked
Active
Viewed 35 times
0
-
Which OS do you use? – Insung Park Nov 27 '20 at 13:19
-
Some JDKs (as Oracle JDK) comes with a auto setup that configure all the environment without setting path variable (depending on the download that you have done). That means installing the JDK in the Java folder (C:\Program Files\Java\
) and setting the environment to use the fresh version installed. Then, if you want to manually configure your Java environment, should download only `.zip` and `.tar` versions, extract it and set it to path. – viniciusmfelix Nov 27 '20 at 13:21 -
@InsungPark windows 10 – Shashika Srimal Nov 27 '20 at 13:23
-
@viniciusmfelix ahh right. that may be the reason. i was so curious to know the reason – Shashika Srimal Nov 27 '20 at 13:24
-
You can have different versions at the same time. Check this: https://stackoverflow.com/a/271623/6150881 – Rabhi salim Nov 27 '20 at 14:41