{"id":354,"date":"2007-10-21T00:00:00","date_gmt":"2007-10-21T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=354"},"modified":"2007-10-21T00:00:00","modified_gmt":"2007-10-21T00:00:00","slug":"Setting Package Version Information","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=354","title":{"rendered":"Setting Package Version Information"},"content":{"rendered":"<p><DIV id=PageTitle>Setting Package Version Information<\/DIV><br \/>\n<BLOCKQUOTE>You may need to include package version information in a JAR file&#8217;s manifest. You provide this information with the following headers in the manifest:<br \/>\n<P><br \/>\n<TABLE cellPadding=5 border=1><br \/>\n<CAPTION><STRONG>Headers in a manifest <\/STRONG><\/CAPTION><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TH>Header<\/TH><br \/>\n<TH>Definition<\/TH><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Name<\/TT><\/TD><br \/>\n<TD>The name of the specification.<\/TD><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Specification-Title<\/TT><\/TD><br \/>\n<TD>The title of the specification.<\/TD><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Specification-Version<\/TT><\/TD><br \/>\n<TD>The version of the specification.<\/TD><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Specification-Vendor<\/TT><\/TD><br \/>\n<TD>The vendor of the specification.<\/TD><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Implementation-Title<\/TT><\/TD><br \/>\n<TD>The title of the implementation.<\/TD><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Implementation-Version<\/TT><\/TD><br \/>\n<TD>The build number of the implementation.<\/TD><\/TR><br \/>\n<TR><br \/>\n<TD><TT>Implementation-Vendor<\/TT><\/TD><br \/>\n<TD>The vendor of the implementation.<\/TD><\/TR><\/TBODY><\/TABLE><\/P><br \/>\n<P>One set of such headers can be assigned to each package. The versioning headers should appear directly beneath the <TT>Name<\/TT> header for the package. This example shows all the versioning headers: <\/P><br \/>\n<BLOCKQUOTE><PRE>Name: java\/util\/<br \/>\nSpecification-Title: Java Utility Classes<br \/>\nSpecification-Version: 1.2<br \/>\nSpecification-Vendor: Sun Microsystems, Inc.<br \/>\nImplementation-Title: java.util<br \/>\nImplementation-Version: build57<br \/>\nImplementation-Vendor: Sun Microsystems, Inc.<br \/>\n<\/PRE><\/BLOCKQUOTE><br \/>\n<P><\/P><br \/>\n<P>For more information about package version headers, see the <A class=OutsideLink href=\"http:\/\/java.sun.com\/javase\/6\/docs\/technotes\/guides\/versioning\/spec\/versioning2.html#wp89936\" target=_blank>Package Versioning specification <\/A>. <\/P><\/BLOCKQUOTE><br \/>\n<P><\/P><br \/>\n<H3>An Example<\/H3><br \/>\n<BLOCKQUOTE>We want to include the headers in the example above in the manifest of MyJar.jar.<br \/>\n<P>We first create a text file named <TT>Manifest.txt<\/TT> with the following contents: <\/P><br \/>\n<BLOCKQUOTE><PRE>Name: java\/util\/<br \/>\nSpecification-Title: Java Utility Classes<br \/>\nSpecification-Version: 1.2<br \/>\nSpecification-Vendor: Sun Microsystems, Inc.<br \/>\nImplementation-Title: java.util<br \/>\nImplementation-Version: build57<br \/>\nImplementation-Vendor: Sun Microsystems, Inc.<br \/>\n<\/PRE><\/BLOCKQUOTE><br \/>\n<BLOCKQUOTE><br \/>\n<HR><br \/>\n<STRONG><FONT color=red>Warning<\/FONT> :<\/STRONG>&nbsp;The text file 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.<br \/>\n<HR><br \/>\n<\/BLOCKQUOTE>We then create a JAR file named <TT>MyJar.jar<\/TT> by entering the following command:<br \/>\n<BLOCKQUOTE><PRE>jar cmf MyJar.jar Manifest.txt MyPackage\/*.class<br \/>\n<\/PRE><\/BLOCKQUOTE>This creates the JAR file with a manifest with the following contents:<br \/>\n<BLOCKQUOTE><PRE>Manifest-Version: 1.0<br \/>\nCreated-By: 1.6.0 (Sun Microsystems Inc.)<br \/>\nName: java\/util\/<br \/>\nSpecification-Title: Java Utility Classes<br \/>\nSpecification-Version: 1.2<br \/>\nSpecification-Vendor: Sun Microsystems, Inc.<br \/>\nImplementation-Title: java.util<br \/>\nImplementation-Version: build57<br \/>\nImplementation-Vendor: Sun Microsystems, Inc.<br \/>\n<\/PRE><\/BLOCKQUOTE><\/BLOCKQUOTE><br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting Package Version Information You may need to include package version information in a JAR file&#8217;s manifest. You provide this information with the following headers in the manifest: Headers in a manifest Header Definition Name The name of the specification. Specification-Title The title of the specification. Specification-Version The version of the specification. Specification-Vendor The vendor &hellip; <a href=\"https:\/\/www.strongd.net\/?p=354\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Setting Package Version Information<\/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-354","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/354","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=354"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}