Creating a JAR Manifest
See Also
In the IDE, there are two ways to specify a manifest for a JAR file:
- Manually create the manifest file and specify this file as part of the JAR contents in the JAR
recipe. You can then later modify the manifest in the Source Editor instead of in
a property editor. When you recompile the JAR file, the modified manifest is included in the JAR file.
- Use the JAR manifest property editor.
To add the manifest when you specify the contents of the JAR file:
- Write the manifest and save it to a file named MANIFEST.MF. The file must be saved in a directory that is mounted in the IDE.
- Create a JAR recipe file. See Creating a JAR File for more information.
- In the Specify JAR Recipe Contents page of the New wizard, add the MANIFEST.MF file to JAR recipe.
- In the Modify JAR Recipe Contents page of the New wizard, set the Target Directory for the MANIFEST.MF file to META-INF.
- Do not type, generate, or load any text in the JAR Manifest page. Manifest information that you provide
on this page overrides any manifest that you specify as part of the JAR Recipe contents.
If the JAR recipe has already been created, you can change the specified manifest through the JAR recipe node's property sheet. Edit the Contents property to add the manifest to the JAR contents. Edit the Manifest property to delete a manifest you have previously created
on the JAR Manifest page.
To use the Manifest property editor to specify the manifest:
- Select the JAR recipe node for the JAR file in the Filesystems window.
- If the Properties window is not open, right-click the JAR recipe node and choose Properties.
- On the property sheet, select the Manifest property and click the ellipsis (...) button.
- In the Manifest property editor, you can:
- Click the Generate button to generate basic attributes.
- Click the Load Manifest from File button and choose a file containing the manifest text you want to use. If you load a manifest this way, you need to reload the manifest each time you rebuild the JAR file.
- Edit generated or loaded manifest content in the text area.
- Write the manifest yourself in the text area.
If you click Load Manifest From File, any text in the text area is replaced
by the loaded text. If you click Generate, any matching basic attributes are
replaced and any syntactically incorrect entries are removed.
 |
For information on manifest syntax, visit
http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html. |
Legal Notices