Danreb Saldana
Danreb Saldana

Reputation: 11

Running another JRE aside from the default version

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

Answers (2)

Tim Bender
Tim Bender

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

hmjd
hmjd

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

Related Questions