Hi Everyone
I am trying to set JAVA_HOME dynamically. I am trying to set the value in the registry but that is not getting refreshed. For example my scenario is this
1) Run a
java Program
2) User selects one java version out of many available java versions
3) User clicks a button which internally takes the input and changes the java version.
I tried doing the following code snippet
On doing the above I could able to change the registry value but when I run java applications it is still using the previous java version not the changed one.
Can anyone help me how to change the java version by using the registry or by any other means?
Please note that
setx command cannot be used in my machine since mine is Windows XP so it would be very helpful if anyone help me to provide a solution other than what mentioned.
Thanks
Vijay