File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes create *.exe (executable program) ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "create *.exe (executable program) ?" Watch "create *.exe (executable program) ?" New topic

create *.exe (executable program) ?

Thomas Whalen
Ranch Hand

Joined: Aug 26, 2001
Posts: 123
Even though I am just beginning in Java I would like to know how to convert a java application to a program that can be run just by clicking on it from the computer's desktop??? otherwise, i don't like the idea of running applications from the JRE or from an IDE.

if you don't know, then ask. if you do know, then share. love is knowledge.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Create a .bat file (or it's equivalent) then you can set the classpath to what you want etc.
This is a .bat file that sets the path to the jre that was bundled with this application, and sets the classpath, invokes the app and brings in a properties file. The actual call to the app is bolded.

cd \"Program Files"\app
path = .;C:\"Program Files"\app;C:\"Program Files"\app\jre\bin;
"c:\Program Files\app\jre\bin\javaw" -classpath .;"c:\Program Files\app";"c:\Program Files\app\app.jar";"c:\Program Files\app\deploy.jar";"c:\Program Files\app\jre\lib\rt.jar";"c:\Program Files\app\jre\lib\jaws.jar";"c:\Program Files\app\jre\lib\i18n.jar";"c:\Program Files\app\classes12.jar";"c:\Program Files\app\images" app.client.APPDesktop "c:\Program Files\app\"

There is an icon that points to this bat file so the user can just click the icon.
[This message has been edited by Cindy Glass (edited November 12, 2001).]

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: create *.exe (executable program) ?
It's not a secret anymore!