(1) Research:
Here are notes from books. Obviously, the solution to this problem involvessimply looking-up "manifest files" on the Internet.
(1) The manifest.txt (or dot mf) file:
Main-Class: ClassName
Where the ClassName is the fully qualified name of the class that contains the main method that is executed to start the application. It isn't required, but it's typical to use the extension.mf for manifest files.
For example, suppose you have an application whose main class is GuessingGame, and all the class files for the application are in the package com.lowewriter.game. First, create a manifest file named game.mf in the com\lowewriter\game directory. This file contains the following line:
Main-Class: com.lowewriter.game.GussingGame
Then, run the jar command with the options cfm, the name of the archive to create, the name of the manifest file, and the path for the class files. For example:
jar cfm game.jar com\lowewriter\game\game.mf com\loweweriter\game\*.class
Now, you can run the application directly from a command prompt by using the java comand with the -jar switch and the name of the archive file. For example:
java -jar game.jar
This command starts the JRE and executes the main method of the class specified by the manifest file in the game.jar archive file.
If your operating system is configured properly, you can also run the application by double-clicking an icon for the jar file.
(2) You can add images to a Manifest file if you want.
(3) Complex manifests can have many more entries. The manifest entries are grouped into sections. The first section in the manifest is called the mainsection. It applies to the whole JAR file. Subsequent entries can specify properties of named entities such as individual files, packages, or URLs. Those entries must begin with a Name entry. Sections are separated by blank lines. For example,
Manifest-Version: 1.0
lines describing this archive
Name: Woozle.class
lines describing this file
Name: com/mycompany/mypkg/
lines describing this package
To edit the manifest, place the lines that you want to add to the manifest into a text file. Then run
jar cfm JARFileName ManifestFileName ...
For example, to make a new JAR file with a manifest, run:
jar cmf MyArchive.jar manifest.mf com/mycompany/mpkg/*.class
To add items to the manifest of an existing JAR file, place the additions into a text file and use a command such as
jar ufm MyArchive.jar manifest-additions.mf