I have an application that i need to distribute as a jar but i have no idea how to create the jar archive as well as something called the manifest file. Basically i have only one class and the main is in that class itself. The path of the of the the file i want to archive is as follows:
and the path of my of my jar.exe is as follows:
Could someone also explain(in detail if possible) to me or direct me to an informative website that explains what the manifest file is all about and also how to write a manifest file.
To create a JAR file having a manifest with the appropriate Main-Class header, you can use the Jar tool's m flag as described in the Modifying a Manifest section. You would first prepare a text file consisting of single line with the Main-Class header and value. For example, if your application was the single-class HelloWorld application, the entry point would of course be the HelloWorld class, and your text file would have this line:
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
With your JAR file prepared in this way, you can run the HelloWorld application from the command line:
java -jar app.jar
I just created a file called "mainClass", and typed the above, voila!