Wednesday, January 14, 2015

Resolve between two different versions of JAVA in Windows

At times we end up having to test our legacy J2EE Applications in more than one Java environment where there arises a need to switch between different versions of Installed Java Editions.

we start up with this article assuming the readers have two different versions of JDK installed in their system.

Lets' set up the Environment Variable for the respective Versions of JDK

1. Set up the JAVA7_HOME Variable for Jdk 7


2. Set up the JAVA6_HOME Variable for Jdk 6




3. Set up the JAVA_HOME variable and set the value pointing to one the editions set above.

4. Insert a Path Variable as %JAVA_HOME%\bin and make sure it is inserted before %SystemRoot%\System32 (Normally java.exe resides in this path and we prevent the system from referring this path and look at the JAVA_HOME path instead)


 5. run java -version from cmd to check  the version of Java running in the system. In case if we want to switch onto another version update the JAVA_HOME value and restart cmd to check for running version






No comments:

Post a Comment