try {
// Open the JAR file
JarFile jarfile = new JarFile("filename.jar");
// Get the manifest
Manifest manifest = jarfile.getManifest();
// Get the main attributes in the manifest
Attributes attrs = (Attributes)manifest.getMainAttributes();
// Enumerate each attribute
for (Iterator it=attrs.keySet().iterator(); it.hasNext(); ) {
// Get attribute name
Attributes.Name attrName = (Attributes.Name)it.next();
// Get attribute value
String attrValue = attrs.getValue(attrName);
}
} catch (IOException e) {
}