Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Jar Files

807606Apr 7 2007 — edited Apr 7 2007
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" SET PATH=%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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2007
Added on Apr 7 2007
1 comment
169 views