Once I install jdk 8 and jdk 10, jdk version 10 is getting configured as system JDK. Even though I change JAVA_HOME, PATH to jdk 8, system jdk does not changes. After changing path and JAVA_HOME if I check version of java in command prompt, it shows jdk 8. But if I double click an executable jar file it takes system jdk i.e. jdk 10.
I tried changing registry to edit the system jdk paths and versions but it didn't work.
From configure java I can only see jdk 10 as configured as system jdk and non editable.
Please help if you are able to switch jdk versions as system jdk.
Steps to replicate issue:
- install jdk 8
- install jdk 10
- without uninstalling jdk 10 change java home and path to jdk 8 from command prompt check java version, it will show jdk 8
- Now try to run an executable jar by double click on desktop. It will take jdk 10. That is the issue.
NOTE: This is not a duplicate post. There are posts on switching between jdk6 or 7 or 8 but not with jdk 10. JDK 10 also does not comes with zip distribution from oracle, it comes only as installable file.