Java FAQ _01 Basic concept (008) _jar What is

Source: Internet
Author: User

Click to enter _ more _java thousand ask

1. What is a jar?

The JAR (Java Archive) is a platform-independent file format. Can contain multiple files, several Java applets and their necessary components (. class files, pictures, sounds, and so on) can be packaged in a jar file.

Learn Javaapplet look here: Javaapplet is what

The jar file format is based on a ZIP file format that can be compressed/decompressed by various operating systems. Unlike Zip, jar files are not only used for compression and publishing, but are also used to encapsulate libraries, components, and plug-ins, as well as deployment programs, and can be used directly by tools such as compilers and JVMs.

You can include special files in jars, such as: manifests and deployment descriptors, to indicate how the tool handles a particular jar.

The advantage of using a jar is that it can increase the speed of network transmission, and the jar also supports compression, reduces the file size, and further improves the transmission efficiency.

In addition, it is fully extensible and corresponds to the API in the Java.util.jar package. Learn Java.util.jar package look here: [Java.lang.ref bag What is the use of][2]

2. What is the difference between jar and zip?

The jar file format offers many advantages and functionality, many of which are traditional compression formats such as ZIP or rar do not. The differences and linkages between them mainly include:

    1. Security
      The jar file can be digitally signed. This allows the signature-aware tool to selectively grant software security privileges to the user, which is not available in zip, and the digital signature detects if the code has been tampered with.

    2. Reduce download time
      If an applet is bundled into a jar, the browser can download the applet's class file and related resources in an HTTP request instead of opening a new connection to each file.

    3. Compression
      As with zip, the jar format also allows you to compress files to improve storage efficiency.

    4. Platform Extensions
      The Java extension Framework (Java Extensions Framework) provides a way to add functionality to the Java core platform, which is packaged with jars.

    5. Package Sealing
      Packages stored in JAR files can be sealed to enhance version consistency and security. Sealing a jar package means that all classes in the jar package must be in the same jar file.

    6. Package version Control
      A jar can contain data about its files, such as vendor and version information.

    7. Portability
      The mechanism for working with jars is a standard part of the Java Platform Core API that can be used without problems across platforms.

Java FAQ _01 Basic concept (008) _jar What is

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.