I was making a jar file for testing something. I had given a manifest file and a set of classes by the following command line:
jar cvfm myjar.jar mymanifest.mf *.class
When I used myjar.jar, the manifest entries I specified in my mymanifest.mf were not working as expected. I opened the jar and checked the added manifest.mf in the jar file -- it did not have attributes defined in mymanifest.mf in it! In fact, my manifest.mf had just one attribute!! It turned out that I was bitten by whitespace -- newline was missing at the end of the attribute. Apparently, manifest file spec. mandates newline at the end of attributes. jar tool did not complain about my manifest file
Moral of the story: beware of whitespaces!