This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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
posted
0
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 ]
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
posted
0
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
posted
0
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
posted
0
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
posted
0
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
posted
0
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...)