Skip to main content

run java with specified version

3 replies [Last post]
ayman_java
Offline
Joined: 2003-10-29

If I have tow versions of java installed, how I can run java application choosing one of them?
lets say I have 1.5 and 1.6 and I want to use 1.6 not 1.5.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carloscs
Offline
Joined: 2003-08-11

A bit late, but here goes for posterity:

run with any 1.5 vm: java -version:1.5*

run with 1.6_0_10 or later vm: java -version:1.6_0_10+

run with 1.6_0_10 or later BUT only 1.6 versions (exclude 1.7* for example): java -version:"1.6_0_10+&1.6*"

http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html

jammychen
Offline
Joined: 2009-06-17

You can specifies the jdk install jre dir path to run java application, For example:

C:\ProgramFiles\Java\jdk1.5.0_22\jre\bin\java org.test.main

ayman_java
Offline
Joined: 2003-10-29

How do I know the location of installed Java, usually it's on C. what if some one installed it on D: