• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Create Java executables

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jar file is probably the best solution, but you may write a bat file to launch your appz (very easy)
 
JeF Ald
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok but doesn't the batch file defeat the purpose of having a platform neutral program
 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
JeF Ald
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, check out Appendix B - Creating A JAR File of The Game Tutorials.
 
reply
    Bookmark Topic Watch Topic
  • New Topic