File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Jar files" Watch "Jar files" New topic
Author

Jar files

Ranjith Singh
Greenhorn

Joined: Nov 29, 2000
Posts: 5
hi
I saw some jar file which run just like exe files, where you can double click and run. I tried to create my owen executable jar file by usimg jar command.
i created the jar file but does not execute when double click it.
What is wrong with that?
Pls some body help me.
Sahir Shah
Ranch Hand

Joined: Nov 05, 2000
Posts: 158

You need to include a manifest file which tells the JVM which class should be loaded first.Create a text file and add a line like this
Main-Class: YourMainClass
do not use .class extension just the class name. And add this to your jar archive in a subdirectory called meta-inf . Alternately you can use the jar utility to create the manifest file.
Finally it may be necessary to create the necessary association for files with .jar extension before the OS can invoke the correct program to run this file with.
Rgds
Sahir


....
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Jar files
 
Similar Threads
Java executable
JAR file problem
How to make jar file executeable ?
how to create exe file
how to create the excutable jar?