Reputation: 63259
I am running the following - and the resulting MANIFEST.MF does not contain the one referenced below:
jar -cvf instrument.jar -m instrument/META-INF/MANIFEST.MF -C instrument .
Here is the intended MANIFEST.MF:
18:23:20/shared $ll instrument/META-INF/MANIFEST.MF
-rw-r--r-- 1 steve staff 33 Mar 31 17:57 instrument/META-INF/MANIFEST.MF
Here is the resulting jar file (notice incorrect date/size of MANIFEST.MF)
18:34:02/shared $jar -tvf instrument.jar
0 Tue Mar 31 17:58:58 PDT 2015 META-INF/
68 Tue Mar 31 17:58:58 PDT 2015 META-INF/MANIFEST.MF
544 Tue Mar 31 17:56:42 PDT 2015 ObjectSizeFetcher.cl
Here are contents of the intended manifest:
18:36:39/shared $cat instrument/META-INF/MANIFEST.MF
Premain-Class: ObjectSizeFetcher
Here are actual contents inside the jar file:
8:35:38/x2 $cat META-INF/MANIFEST.MF
Manifest-Version: 1.0
Created-By: 1.7.0_25 (Oracle Corporation)
Upvotes: 3
Views: 855
Reputation: 40508
You have to list all the options, except -C first, then the arguments (yeah, I know, original :)) and also provide the list of files to include
jar -cvfm instrument.jar instrument/META-INF/MANIFEST.MF -C instrument .
should do what you want.
Upvotes: 3