You are here

How to open a jar file with Java 6, but also keep Java 7 on USB?

1 post / 0 new
Loui8
Offline
Last seen: 8 years 7 months ago
Joined: 2007-01-04 14:12
How to open a jar file with Java 6, but also keep Java 7 on USB?

I have a Java jar file which I need to open with Java 6. JavaPortableLauncher I believe runs Java 7 (if installed).

I need to have both Java 6 and 7 on my USB stick. How can I run the specific jar file with Java 6 while also keeping Java 7 on the USB stick for all other applications?

EDIT: I found that I could use a command [path to]\java.exe -jar [path to]\MyProgram.exe to start MyProgram.exe. However a database file which MyProgram.exe creates or uses if it already exists, is always created in the Java directory, and not where MyProgram.exe is located. Thus although this is a possible solution, it's not really optimal, as I would like the database file to be created/located where MyProgram.exe is.