How to attach MANIFEST.MF file in jar in/using eclipse?

UPDATED: 23 October 2013
Every jar file you create using editor it explicitly attach MANIFEST.MF file in it. That contains basic information of that jar file. I was also generating jar file using editor regardless its MANIFEST.MF file. After major security changes in Java 1.7.0_45 its mandatory to specify some attribute in MANIFEST.MF in Applet jar. But its good practice to add this MANIFEST.MF file with proper information in it, whether its applet or simple jar file.

Step 1: Open up simple notepad or other text editor. Add your required attribute in it and save as "MANIFEST.MF" . Here is all attribute information of MANIFEST.MF file. This is my sample MANIFEST.MF file.
Manifest-Version: 1.0
Codebase: *
Permissions: all-permissions
Application-Library-Allowable-Codebase: *
Caller-Allowable-Codebase: *
Application-Name: Digital Certificate
Ant-Version: Apache Ant 1.8.3
Created-By: 1.6.0_25-b06 (Sun Microsystems Inc.)

Step 2: Copy MANIFEST.MF file in your project's folder.

jar, applet, manifest, eclipse

Step 3: Right click on project / file and click on Export.

jar, applet, manifest, eclipse

Step 4: Select JAR file in dialog box and click Next.

jar, applet, manifest, eclipse

Step 5: Select your output file and its location. And click Next.

jar, applet, manifest, eclipse

Step 6: Click Next in JAR Packaging option.
Step 7: Select "Use existing manifest from workspace" and browse your MANIFEST.MF file and click on finish. 

jar, applet, manifest, eclipse

Other Resources:
How to attach MANIFEST.MF file in jar in/using Netbeans?

0 comments :