Packaging Programs in JAR Files

原文地址:http://docs.oracle.com/javase/tutorial/deployment/jar/index.html

注:非常实用的一个关于Jar的教程


The Java™ 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 file. Users who recognize your signature can then optionally grant your software security privileges it wouldn't otherwise have.
  • Decreased download time: If your applet is bundled in a JAR file, the applet'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.
  • Compression: The JAR format allows you to compress your files for efficient storage.
  • Packaging for extensions: 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. By using the JAR file format, you can turn your software into extensions as well.
  • Package Sealing: 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.
  • Package Versioning: A JAR file can hold data about the files it contains, such as vendor and version information.
  • Portability: The mechanism for handling JAR files is a standard part of the Java platform's core API.

This lesson has four sections:

Using JAR Files: The Basics

This section shows you how to perform basic JAR-file operations, and how to run software that is bundled in JAR files.

Working with Manifest Files: The Basics

This section explains manifest files and how to customize them so you can do such things as seal packages and set an application's entry point.

Signing and Verifying JAR Files

This section shows you how to digitally sign JAR files and verify the signatures of signed JAR files.

Using JAR-related APIs

This section introduces you to some of the JAR-handling features of the Java platform. The JAR file format is an important part of the Java platform's extension mechanism. You can learn more about that aspect of JAR files in the The Extension Mechanism trail of this tutorial.

Questions and Exercises: JAR

Test what you've learned about JAR.

Additional References

The documentation for the Java Development Kit (JDK) includes information about the Jar tool:



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值