{"id":361,"date":"2007-10-21T00:00:00","date_gmt":"2007-10-21T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=361"},"modified":"2007-10-21T00:00:00","modified_gmt":"2007-10-21T00:00:00","slug":"Modifying a Manifest File","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=361","title":{"rendered":"Modifying a Manifest File"},"content":{"rendered":"<p><DIV id=PageTitle>Modifying a Manifest File<\/DIV><br \/>\n<BLOCKQUOTE>You use the <TT>m<\/TT> command-line option to add custom information to the manifest during creation of a JAR file. This section describes the <TT>m<\/TT> option.<br \/>\n<P>The Jar tool automatically puts a <A href=\"http:\/\/www.strongd.net\/blog\/show\/359\">default manifest<\/A> with the pathname <TT>META-INF\/MANIFEST.MF<\/TT> into any JAR file you create. You can enable special JAR file functionality, such as <A href=\"http:\/\/www.strongd.net\/blog\/show\/360\">package sealing<\/A><A>, by modifying the default manifest. Typically, modifying the default manifest involves adding special-purpose <I>headers<\/I> to the manifest that allow the JAR file to perform a particular desired function. <\/A><\/P><br \/>\n<P><A>To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool&#8217;s <TT>m<\/TT> option to add the information in your file to the manifest. <\/A><\/P><br \/>\n<BLOCKQUOTE><br \/>\n<HR><br \/>\n<A><STRONG><FONT color=red>Warning<\/FONT> :<\/STRONG>&nbsp; The text file from which you are creating the manifest must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return. <\/A><br \/>\n<HR><br \/>\n<\/BLOCKQUOTE><br \/>\n<P><\/P><br \/>\n<P><A>The basic command has this format: <\/A><\/P><br \/>\n<BLOCKQUOTE><PRE><A>jar cfm <I>jar-file manifest-addition input-file(s)<\/I><br \/>\n<\/A><\/PRE><\/BLOCKQUOTE><br \/>\n<P><\/P><A>Let&#8217;s look at the options and arguments used in this command: <\/A><br \/>\n<UL><br \/>\n<LI><A>The <TT>c<\/TT> option indicates that you want to <EM>create<\/EM> a JAR file. <\/A><\/LI><br \/>\n<LI><A>The <TT>m<\/TT> option indicates that you want to merge information from an existing file into the manifest file of the JAR file you&#8217;re creating. <\/A><\/LI><br \/>\n<LI><A>The <TT>f<\/TT> option indicates that you want the output to go to a <EM>file<\/EM> (the JAR file you&#8217;re creating) rather than to standard output. <\/A><\/LI><br \/>\n<LI><A><EM><TT>manifest-addition<\/TT><\/EM> is the name (or path and name) of the existing text file whose contents you want to add to the contents of JAR file&#8217;s manifest. <\/A><\/LI><br \/>\n<LI><A><EM><TT>jar-file<\/TT><\/EM> is the name that you want the resulting JAR file to have. <\/A><\/LI><br \/>\n<LI><A>The <EM><TT>input-file(s)<\/TT><\/EM> argument is a space-separated list of one or more files that you want to be placed in your JAR file. <\/A><\/LI><\/UL><br \/>\n<P><A>The <TT>m<\/TT> and <TT>f<\/TT> options must be in the same order as the corresponding arguments. <\/A><\/P><br \/>\n<P><\/P><br \/>\n<BLOCKQUOTE><br \/>\n<HR><br \/>\n<A><STRONG><FONT color=red>Note<\/FONT> :<\/STRONG>&nbsp;The contents of the manifest must be encoded in UTF8. <\/A><br \/>\n<HR><br \/>\n<\/BLOCKQUOTE><br \/>\n<P><\/P><br \/>\n<P><A>The remaining sections of this lesson demonstrate specific modifications you may want to make to the manifest file. <\/A><\/P><\/BLOCKQUOTE><br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modifying a Manifest File You use the m command-line option to add custom information to the manifest during creation of a JAR file. This section describes the m option. The Jar tool automatically puts a default manifest with the pathname META-INF\/MANIFEST.MF into any JAR file you create. You can enable special JAR file functionality, such &hellip; <a href=\"https:\/\/www.strongd.net\/?p=361\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Modifying a Manifest File<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=361"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}