Reputation: 11
How can I run a java version (1.6.0_20) when the default java version installed in my machine is Java 1.6.0_30?
Upvotes: 1
Views: 67
Reputation: 20442
From the command line, explicitly use the version of the Java executable that you want.
C:\Program Files\java\jdk1.6.0_20\bin\java <Main>
With Eclipse IDE, you can set the JDK to use in the project settings.
With a general system setup, change the PATH
and JAVA_HOME
variables to point to the desired version.
Upvotes: 2
Reputation: 121961
You need to modify your PATH
environment variable:
$ export JAVA_HOME=/java/1.6.0_20 # Unsure if this definitely necessary. $ export PATH=$JAVA_HOME/bin:$PATH
Upvotes: 2