I have two versions of Java setup for development. One is 1.5 and the other obviously is 1.6.
Now when I type java -version it displays up 1.6
What should I change so that it points to Java 1.5?
I have two versions of Java setup for development. One is 1.5 and the other obviously is 1.6.
Now when I type java -version it displays up 1.6
What should I change so that it points to Java 1.5?
On Windows:
1) set your JAVA_HOME environment variable to the 1.5 location, one level above the /bin dir, e.g. C:\myjava5dir, not C:\myjava5dir\bin
2) then set your PATH environment variable to include %JAVA_HOME%\bin
3) be sure to start a new DOS prompt to pick up the changes
Also ensure you clear any other existing references to your jdk in PATH.
JAVA_HOME is not actually required by any JDK itself. Some third-party applications use it (for example the Tomcat startup scripts use it), but Java itself doesn't need and/or use it at all!