Changing current version of Java within Windows

java

I'm working in a Windows XP environment and have recently installed java 1.6 because it was required by an application.

However I don't want this to be the default version of java to be used. How do I set it so that the command java -version will return 1.5.x

Best Answer

Change your PATH variable so that it has the location of the jdk5/bin directory:

  1. Start -> Control Panel -> System -> Advanced
  2. Click on Environment Variables, under System Variables, find PATH, and click on it.
  3. In the Edit windows, modify PATH by adding the location of your jdk5/bin directory to the beginning. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the directory as the value.
  4. Close the window.
  5. Reopen Command prompt window, and run java -version
Related Question