I have developed a Java Program using Swing and other packages. And I want to give this program to my friend to test it, my friend has JRE installed in his machine. So how to put my program in a jar format to use it? (I mean, is there some way to use jar format, so when my friend "double-clicked" in this jar my application will start?) Waiting for your answers ranchers. Survive.
There are two parts to the answer. One part is that the JAR file's WEB-INF/MANIFEST.MF file has to have a "Main-Class" entry that points to the main class of the application. The other part is that your friend's computer has to be properly configured to handle clickable JAR files -- I think Sun's standard installer sets this up automatically, so he should be all set. Here are some more details.
Thank you very much DR.Friedman-Hill, I found a tutorial from java.sun.com but this tutorial said : "Assuming your text file was in a file called mainClass, you could merge it into a JAR file's manifest with a command such as this: jar cmf mainClass app.jar HelloWorld.class " I tried this command, but the following exception is thrown: FileNotFoundException: mainClass (The system can't find the file specified) So what is the problem??