Jar Files

I'm trying to create an exectionable Jar file to run on different computers.Im going to place the Jar file in exe archive with WinRar which will execute a .bat file.What command lines will set the correct path ?(unknown java version)!!At the moment Im just cycling through all the possibilties of the default location of javaw.exe ie.

If EXIST "%ProgramFiles%\java\jdk1.5.0_09\bin\javaw.exe" SETPATH=%ProgramFiles%\java\jdk1.5.0_09\bin";%PATH%

If EXIST "%ProgramFiles%\java\jdk1.5.0_08\bin\javaw.exe" SET PATH=%ProgramFiles%\java\jdk1.5.0_08\bin";%PATH%

....

Is there a way to just search for javaw.exe with cmd i dont need it to be efficiant as this will only be done once on the initial start up

Also when i packege the jar file it will run fine with

javaw -jar filename.jar

I assciated .jar with javaw.exe with this:

(changes the .jar icon)

assoc .jar=Jar

FTYPEJar="path\bin\javaw.exe" %1 %*

but i get "JVM could not find main-class"

....

Thanks in advance

Message was edited by:

Ger@newToProgramming

[1105 byte] By [Ger@newToProgramminga] at [2007-11-27 0:20:18]
# 1
Look at the System class method getProperties documentation. It lists system properties that are accessible and should be of use to you.
ChuckBinga at 2007-7-11 22:13:08 > top of Java-index,Java Essentials,Java Programming...