{"id":377,"date":"2007-10-21T00:00:00","date_gmt":"2007-10-21T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=377"},"modified":"2007-10-21T00:00:00","modified_gmt":"2007-10-21T00:00:00","slug":"Packaging Programs in JAR Files","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=377","title":{"rendered":"Packaging Programs in JAR Files"},"content":{"rendered":"<p><DIV><br \/>\n<DIV id=PageTitle>Packaging Programs in JAR Files<\/DIV><br \/>\n<BLOCKQUOTE><!-- Lesson: Packaging Programs in JAR Files -->The Java<SUP><FONT size=-2>TM<\/FONT><\/SUP> Archive (JAR) file format enables you to bundle multiple files into a single archive file. Typically a JAR file contains the class files and auxiliary resources associated with applets and applications.<br \/>\n<P>The JAR file format provides many benefits: <\/P><br \/>\n<UL><br \/>\n<LI><EM>Security<\/EM>: You can digitally sign the contents of a JAR file. Users who recognize your signature can then optionally grant your software security privileges it wouldn&#8217;t otherwise have. <\/LI><br \/>\n<LI><EM>Decreased download time<\/EM>: If your applet is bundled in a JAR file, the applet&#8217;s class files and associated resources can be downloaded to a browser in a single HTTP transaction without the need for opening a new connection for each file. <\/LI><br \/>\n<LI><EM>Compression<\/EM>: The JAR format allows you to compress your files for efficient storage. <\/LI><br \/>\n<LI><EM>Packaging for extensions<\/EM>: The extensions framework provides a means by which you can add functionality to the Java core platform, and the JAR file format defines the packaging for extensions. <A class=OutsideLink href=\"http:\/\/java.sun.com\/products\/java-media\/3D\" target=_blank>Java 3D\u2122<\/A> and <A class=OutsideLink href=\"http:\/\/java.sun.com\/products\/javamail\/index.html\" target=_blank>JavaMail\u2122<\/A> are examples of extensions developed by Sun<FONT size=-2><SUP>TM<\/SUP><\/FONT>. By using the JAR file format, you can turn your software into extensions as well. <\/LI><br \/>\n<LI><EM>Package Sealing<\/EM>: Packages stored in JAR files can be optionally sealed so that the package can enforce version consistency. Sealing a package within a JAR file means that all classes defined in that package must be found in the same JAR file. <\/LI><br \/>\n<LI><EM>Package Versioning<\/EM>: A JAR file can hold data about the files it contains, such as vendor and version information. <\/LI><br \/>\n<LI><EM>Portability<\/EM>: The mechanism for handling JAR files is a standard part of the Java platform&#8217;s core API. <\/LI><\/UL><br \/>\n<P>This lesson has four sections: <\/P><\/BLOCKQUOTE><!--    Using JAR Files: The Basics    --><br \/>\n<H3><A class=TutorialLink href=\"http:\/\/www.strongd.net\/blog\/show\/370\" target=_top>Using JAR Files: The Basics<\/A><\/H3><br \/>\n<BLOCKQUOTE>This section shows you how to perform basic JAR-file operations, and how to run software that is bundled in JAR files. <\/BLOCKQUOTE><!--    Working with Manifest Files: The Basics    --><br \/>\n<H3><A class=TutorialLink href=\"http:\/\/www.strongd.net\/blog\/show\/364\" target=_top>Working with Manifest Files: The Basics<\/A><\/H3><br \/>\n<BLOCKQUOTE>This section explains manifest files and how to customize them so you can do such things as seal packages and set an application&#8217;s entry point. <\/BLOCKQUOTE><!--    Signing JAR files    --><br \/>\n<H3><A class=TutorialLink href=\"http:\/\/www.strongd.net\/blog\/show\/357\" target=_top>Signing and Verifying JAR Files<\/A><\/H3><br \/>\n<BLOCKQUOTE>This section shows you how to digitally sign JAR files and verify the signatures of signed JAR files. <\/BLOCKQUOTE><!--    Using New JAR-related Features in the JDK 1.2 Software   --><br \/>\n<H3><A class=TutorialLink href=\"http:\/\/www.strongd.net\/blog\/show\/373\" target=_top>Using JAR-related APIs<\/A><\/H3><br \/>\n<BLOCKQUOTE>This section introduces you to some of the JAR-handling features of the Java platform. <!--    JAR Files and the Extension Mechanism    -->The JAR file format is an important part of the Java platform&#8217;s extension mechanism. You can learn more about that aspect of JAR files in the <A href=\"http:\/\/java.sun.com\/docs\/books\/tutorial\/ext\/index.html\">The Extension Mechanism<\/A> trail of this tutorial. <\/BLOCKQUOTE><!--Additional References --><br \/>\n<H3>Additional References<\/H3><br \/>\n<BLOCKQUOTE>The documentation for the Java Development Kit includes information about the Jar tool:<br \/>\n<UL><br \/>\n<LI><A class=OutsideLink href=\"http:\/\/www.strongd.net\/blog\/show\/378\" target=_blank>Java Archive (JAR) Files Guide<\/A> <\/LI><br \/>\n<LI><A class=OutsideLink href=\"http:\/\/www.strongd.net\/blog\/show\/375\" target=_blank>JAR File Specification<\/A> <\/LI><\/UL><\/BLOCKQUOTE><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Packaging Programs in JAR Files The JavaTM Archive (JAR) file format enables you to bundle multiple files into a single archive file. Typically a JAR file contains the class files and auxiliary resources associated with applets and applications. The JAR file format provides many benefits: Security: You can digitally sign the contents of a JAR &hellip; <a href=\"https:\/\/www.strongd.net\/?p=377\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Packaging Programs in JAR Files<\/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-377","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/377","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=377"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/377\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}