Home Java Javagetting Started What file format is jar?

What file format is jar?

Feb 08, 2021 pm 03:28 PM
jar

jar is a software package file format, usually used to aggregate a large number of Java class files, related metadata and resource files into one file in order to develop Java platform application software or libraries; JAR files also refer to a An archive file constructed in ZIP format with a ".jar" file extension.

What file format is jar?

#The operating environment of this article: Windows 7 system, DELL G3 computer, Java8.0.

In the software field, JAR file (Java Archive, English: Java Archive) is a software package file format that is usually used to aggregate a large number of Java class files, related metadata and resources (text, pictures, etc. ) file to a file for developing Java platform applications or libraries.

A JAR file is an archive file built in ZIP format with a .jar file extension. Users can use the JDK's own jar command to create or extract JAR files. You can also use other zip compression tools, but the order of entries in the zip file header is important when compressing, because the Manifest file often needs to be placed first. File names within JAR files are Unicode text.

The JAR file format is based on the popular ZIP file format. Unlike ZIP files, JAR files are not only used for compression and distribution, but also for deployment and packaging of libraries, components and plug-ins, and can be used directly by tools like compilers and JVM. Special files, such as manifests and deployment descriptors, are included in a JAR to instruct tools on how to process a particular JAR.

Related Features

The JAR file format offers many advantages and features, many of which are not provided by traditional compression formats such as ZIP or RAR.

They include:

Security The contents of JAR files can be digitally signed. This way, a tool that recognizes the signature can selectively grant you software security privileges that no other file can, and it can also detect whether the code has been tampered with.

Reduce download time If an applet is bundled into a JAR file, the browser can download the applet's class files and related resources in one HTTP transaction instead of downloading each applet. A file opens a new connection.

Compression The JAR format allows you to compress files to increase storage efficiency.

Transport Platform Extensions The Java Extensions Framework provides a way to add functionality to the Java core platform. These extensions are packaged in JAR files (Java 3D and JavaMail are developed by Sun Developed extended example).

Recommended: "java tutorial"

  • Package seal

Stored in the JAR file Packages can optionally be sealed for enhanced version consistency and security. Sealing a package means that all classes in the package must be found in the same JAR file.

  • Package Versioning

A JAR file can contain 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 core API.

The above is the detailed content of What file format is jar?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to run jar files in Linux How to run jar files in Linux Feb 20, 2024 am 10:40 AM

Prerequisites for running JAR files Running JAR files on a Linux system requires the installation of the Java Runtime Environment (JRE), which is the basic component required to execute Java applications, including the Java Virtual Machine (JVM), core class libraries, etc. Many mainstream Linux distributions, such as Ubuntu, Debian, Fedora, openSUSE, etc., provide software libraries of JRE packages to facilitate user installation. The following article will detail the steps to install JRE on popular distributions. After setting up the JRE, you can choose to use the command line terminal or the graphical user interface to start the JAR file according to your personal preference. Your choice may depend on familiarity with Linux shells and personal preference

How docker deploys SpringBoot and replaces jar packages How docker deploys SpringBoot and replaces jar packages May 12, 2023 pm 02:16 PM

Create a dockerfile file in the project directory dockerfile, which will be used later. The file is deployed in the newly created /data/docker/hellolearn folder on the server (the file path can be customized). Copy the maven packaged jar package and the dockerfile file created above to the newly created folder on the server (/data/docker/hellolearn). . Generate the image dockerbuild-thellolearn.dockerbuild-t Image name: the relative position of the label dockerfile, the dot represents the current directory, and the default is latest if no tag is written. Start container doc

How to package springboot into a jar package in maven How to package springboot into a jar package in maven May 17, 2023 am 08:19 AM

maven command: 1.mvncleanpackage-DskipTests: Run this command in the project directory to generate a jar package or war package in the target directory. 2.mvnclean: Clean the temporary files produced by the project, usually the target directory under the module 3.mvncompile-DskipTests: The module installation command copies the packaged jar/war file to your local warehouse for use by other modules -Dmaven. test.skip=true skips testing (testcompile will also be skipped).4.mvntest: test command, or execute src/test/java/

How to start, stop and restart the springboot jar package in Linux How to start, stop and restart the springboot jar package in Linux May 14, 2023 am 09:37 AM

Foreword In the configuration file of springboot, the names of the configuration files have their own meanings and uses. dev development environment prod production environment (default) test test environment loads the specified configuration file--spring.profiles.active=prod The ways for springboot to load jar packages are/ /Start directly in the console. The disadvantage is that the project will be closed when the console is closed. java-jarbootdo.jar//This method can run in the background, but if the shell is launched, it will also hang java-jar/bootdo-2.0.0.jar>bootdolog.file2>&

How does SpringBoot hang the configuration file outside the jar package? How does SpringBoot hang the configuration file outside the jar package? May 15, 2023 pm 03:01 PM

1. SpringBoot specifies the configuration file path: In SpringBoot, the configuration file can be placed outside the jar package, so that the configuration can be easily modified without repackaging and deployment. The following are several ways to specify the configuration file directory: (sorted from high to low effectiveness priority) 1) Use command line parameters: When starting the application, you can use --spring.config.location or -Dspring.config. The location command line parameter specifies the path to the configuration file, for example: (the / after config cannot be omitted) java-jartest.jar--spring.config.locatio

How does SpringBoot delete useless beans in referenced jar packages? How does SpringBoot delete useless beans in referenced jar packages? May 14, 2023 pm 08:07 PM

Preface: The company has a project that is in a hurry, and some of the project's requirements are the same as some of the functions of previous projects. In order to speed up and directly introduce some modules in the previous multi-module maven project in the form of jar packages. The new project was launched. Although it saved a lot of development time, it also caused the project to need to import the related dependencies of the project jar, causing the project to be bloated and slow to start. Is there a way to make the project load only the beans it needs? Of course, we can directly modify the source code and repackage it to solve the problem, but this method is too troublesome. Through Baidu's method, the query can use the @ComponentScan annotation on the springboot startup class to implement the code example @Componen

How to solve the problem of Java using Class.forName to load external Jar class files How to solve the problem of Java using Class.forName to load external Jar class files May 10, 2023 pm 11:49 PM

The background of the story is in a framework called magic-api. You can write code in a low-code way and dynamically compile and execute it. However, if you want to load some import classes, you need to load the jar in the project before you can import it. Then every time you come to For new classes, you need to reload the class into the project, then package the project, and then import... It is very tedious! ! ! Of course, we also need to mention a general execution process of magic. When you get a copy of the source code, the import on the header file will be loaded into the memory through Class.forName in the source code. Some people will say, then use URLClassLo directly.

How to deploy JAVA project with JAR package on LINUX How to deploy JAVA project with JAR package on LINUX May 23, 2023 pm 02:13 PM

To deploy a java project with a jar package on Linux, first install a small plug-in on eclipse, called fatjar. Click on the red box of fatjar and select the main class. Click next and check the box as shown. Find the jar package under the path and transfer it through the ftp protocol. The jar package is placed under the Linux server, enter the jar package path and enter the command java-jarxxx.jar to run successfully! Notice! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! When you disconnect from the server, the project will stop! So use the following command: nohupjava-jarxxx.jar You can view the process through the command ps-ef|grepjava

See all articles