M
option:jar cvfM no-meta.jar A.classNote: it's upper-case M. Lower-case m has a different meaning.
adding: A.class(in = 405) (out= 279)(deflated 31%)
5. You can specify your own manifest file when creating a jar file, using
m
option:jar cvfm my-meta.jar my-meta-inf\my.mf A.classThe option used here
added manifest
adding: A.class(in = 405) (out= 279)(deflated 31%)
cvfm
tells the jar command that the destination file (f) will come next and then custom manifest file (m). I can also specify them in a different order:jar cvmf my-meta-inf\my.mf my-meta.jar A.classIt's lower-case m. Upper-case M has a different meaning.
added manifest
adding: A.class(in = 405) (out= 279)(deflated 31%)
6.META-INF/MANIFEST.MF file in source files is always ignored.
jar cvf ignore.jar A.class META-INFWhen it comes to manifest files for new jar file, you only have 3 options:
added manifest
adding: A.class(in = 405) (out= 279)(deflated 31%)
ignoring entry META-INF/
adding: META-INF/LICENSE.txt(in = 2657) (out= 1185)(deflated 55%)
ignoring entry META-INF/MANIFEST.MF
- Do not specify any manifest-related options and use the default MANIFEST.MF
- Use option
M
not to include a manifest file - Use option
m
to use a custom manifest file. Inside the jar file, this file will always be named MANIFEST.MF under META-INF directory. Outside of the jar file, this custom manifest file can be anywhere and have any name.
cvfm
option, this custom manifest file is ignored and a default MANIFEST.MF is included.Tags: