File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to set only one version of jre on my Computer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to set only one version of jre on my Computer?" Watch "How to set only one version of jre on my Computer?" New topic
Author

How to set only one version of jre on my Computer?

Tran Tuan Hung
Ranch Hand

Joined: Apr 08, 2007
Posts: 59
In my Computer, i install three version of jre so i want to set a desired jre version, how to do that? May be i must set in control panel???
Thanks and best regard,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38840
    
  23
As far as I know, the computer searches through the PATH environment variable from left to right until it finds an executable matching the requisite name, in this case "java". So try putting the version you want first in the PATH. Test it with java -version at a terminal/command prompt.
Tran Tuan Hung
Ranch Hand

Joined: Apr 08, 2007
Posts: 59
can you explain more clearly? in fact, my computer had 3 jre versions(jre1.5.0_07, 1.5.0_09, 1.6.0_03) been installed. now the jre1.6.0_03 is using, how can i change to jre1.5.0_07???
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 686
On Windows XP, the jre install puts a java.exe file in the Windows/System32 folder which is often at the head of the PATH. I've swapped between jre versions by copying the java.exe file from the bin for the version I want to use to the Windows\System32 folder. Somehow the java.exe uses the Registry to find the rest of the stuff it needs.
I also did the above on Windows 98, but with a different folder.
Tran Tuan Hung
Ranch Hand

Joined: Apr 08, 2007
Posts: 59
i got it,
thanks, thanks, thanks....
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to set only one version of jre on my Computer?