aspose file tools*
The moose likes Beginning Java and the fly likes Create Java executables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Create Java executables" Watch "Create Java executables" New topic
Author

Create Java executables

JeF Ald
Greenhorn

Joined: Mar 21, 2002
Posts: 19
I am developing programs that i want the user to be able to double cick the file and it runs i do not want to have to run the program with the IDE is there a way to do this


Jack of all trades, Master of none
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
If your users will be running Java 1.2 or higher, packaging your application in a jar file would probably give you the functionality you're after.
Take a look at The Jar Files Trail of Sun's Java Tutorial.
Good Luck.
[ June 05, 2002: Message edited by: Dirk Schreckmann ]

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
The jar file is probably the best solution, but you may write a bat file to launch your appz (very easy)


Younes
By constantly trying one ends up succeeding. Thus: the more one fails the more one has a chance to succeed.
JeF Ald
Greenhorn

Joined: Mar 21, 2002
Posts: 19
ok but doesn't the batch file defeat the purpose of having a platform neutral program
Greg Brouelette
Ranch Hand

Joined: Jan 23, 2002
Posts: 144
No, the platform neutral solution is to put the code in a jar with a properly constructed manifest file. Then run the program this way:
java -jar [jar file name]
The batch file is simply a way to make it easier for the customer to run the above command line.
Just make two batch files: one for Dos/WIndows and one for Linux?Unix and you're all set.


For a good Prime, call:<br />29819592777931214269172453467810429868925511217482600306406141434158089
JeF Ald
Greenhorn

Joined: Mar 21, 2002
Posts: 19
ok maybe i dont understand jar files i thought jar files where just like tar files it just puts everything in one file like a zip my delimma is that i want a platform neutral way to click on a file and it runs without having to create a batch file or do *ANY* command line stuff
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Then a jar file is probably what you want to use.
A jar file is a zip file with a little bit more functionality. Browse through the aforementioned tutorial paying special attention to the sections on the Manifest File.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
The question of creating and using jar files comes up quite often, so let's walk through the steps to create one that works...
(Hang on, I'm typing...)
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
OK, check out Appendix B - Creating A JAR File of The Game Tutorials.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create Java executables