search
HomeCommon ProblemWhat is the file format of jar?
What is the file format of jar?Dec 17, 2020 pm 03:12 PM
file formatjar

jar is a software package file format, usually used to aggregate a large number of Java class files, related metadata and resource (text, images, etc.) files into one file; JAR file is an archive file. Built in ZIP format, with ".jar" as the file extension.

What is the file format of jar?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

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.

Features:

  • Security

    You can add digital signatures to the contents of JAR files. 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 files in an HTTP transaction resources instead of opening a new connection for each file.

  • Compression

    The JAR format allows you to compress files for greater 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 examples of extensions developed by Sun).

  • Package Sealing

    Packages stored in JAR files 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.

Related recommendations: "Programming Teaching"

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

Statement
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
docker怎么部署SpringBoot及替换jar包docker怎么部署SpringBoot及替换jar包May 12, 2023 pm 02:16 PM

工程目录dockerfile文件创建dockerfile文件,后面会用到。文件部署在服务器新建/data/docker/hellolearn文件夹(文件路径可自定义),将maven打包好的jar包和上文中创建的dockerfile文件复制到服务器新建的文件夹(/data/docker/hellolearn)。生成镜像dockerbuild-thellolearn.dockerbuild-t镜像名称:标签dockerfile的相对位置,点号代表当前目录,不写tag默认是latest。启动容器doc

如何在 Linux 中运行 jar 文件如何在 Linux 中运行 jar 文件Feb 20, 2024 am 10:40 AM

运行JAR文件的先决条件在Linux系统上运行JAR文件需要安装Java运行时环境(JRE),它是执行Java应用程序所需的基本组件,包括Java虚拟机(JVM)、核心类库等。许多主流Linux发行版,如Ubuntu、Debian、Fedora、openSUSE等,都提供了JRE包的软件库,方便用户进行安装。后文将详细介绍在流行的发行版上安装JRE的步骤。设置完JRE后,可以根据个人喜好选择使用命令行终端或图形用户界面来启动JAR文件。您的选择可能取决于对Linuxshell的熟悉程度和个人偏好

怎么在maven中将springboot打成jar包怎么在maven中将springboot打成jar包May 17, 2023 am 08:19 AM

maven的命令:1.mvncleanpackage-DskipTests:在项目目录下运行此命令,在target目录下生成jar包或war包。2.mvnclean:清理项目生产的临时文件,一般是模块下的target目录3.mvncompile-DskipTests:模块安装命令将打包的的jar/war文件复制到你的本地仓库中,供其他模块使用-Dmaven.test.skip=true跳过测试(同时会跳过testcompile).4.mvntest:测试命令,或执行src/test/java/下

xlsx格式是什么的文件xlsx格式是什么的文件Jul 06, 2022 pm 03:28 PM

xlsx是微软“Office Excel”的表格文件;xlsx基于“Office Open XML”标准的压缩文件取代了以前专有的默认文件格式,在传统的文件扩展名后面添加了“x”,并且任何能够打开“.xlsx”文件的文字处理软件都可以将该文档转换为“.xls”文件。

Linux编辑启动、停止与重启springboot jar包的方法Linux编辑启动、停止与重启springboot jar包的方法May 14, 2023 am 09:37 AM

前言springboot的配置文件中,配置文件的名字都有各自的意义跟用途dev开发环境prod生产环境(默认)test测试环境加载指定配置文件--spring.profiles.active=prodspringboot加载jar包的方式有//直接在控制台进行启动,缺点就是控制台关闭项目也就关闭了。java-jarbootdo.jar//这种方式可以运行在后台,但是如果推出了shell的话,那也会挂java-jar/bootdo-2.0.0.jar>bootdolog.file2>&

SpringBoot怎么将配置文件挂到jar包外面SpringBoot怎么将配置文件挂到jar包外面May 15, 2023 pm 03:01 PM

一、SpringBoot指定配置文件路径:在SpringBoot中,可以将配置文件放在jar包外面,这样可以方便地修改配置而不需要重新打包和部署。下面是指定配置文件目录的几种方法:(按生效优先级从高到低排序)1)使用命令行参数:在启动应用程序时,可以使用--spring.config.location或-Dspring.config.location命令行参数来指定配置文件的路径,例如:(config后面的/不可省略)java-jartest.jar--spring.config.locatio

springboot项目怎么引入本地依赖jar包并打包到lib文件夹中springboot项目怎么引入本地依赖jar包并打包到lib文件夹中May 11, 2023 am 11:37 AM

前言:工作中,碰到过springboot框架构建的javaweb项目,需要集成第三方推送功能,于是使用到了小米推送服务,下载了相关jar包。项目中引入本地jar,问题不大,编写完代码后,通过测试类测试,也没问题。然后就准备打包部署到开发服上。由于项目是通过tomcat部署的,所以打包方式是打成war包。打包后上传到开发服,启动成功后去测试编写的推送接口,发现失败了。通过分析发现,打包后的war中存放项目依赖jar的lib目录中并没有本地引入的推送相关的jar包。折腾了半个小时,才解决了问题。解决

Java使用Class.forName加载外部Jar类文件的问题怎么解决Java使用Class.forName加载外部Jar类文件的问题怎么解决May 10, 2023 pm 11:49 PM

故事背景在一个框架叫magic-api里,可以低代码的方式写代码,动态编译执行,但是要想加载一些import类进来,需要前提在项目里加载jar完成后才可以import,那么这样每来一个新的class,就都需要重新加载class到项目,然后打包项目,再import……非常繁琐!!!当然这边还要提到magic的一个大概执行过程,拿到一份源码时,头文件上的import会经过源码里Class.forName进行加载到内存,有人会说,那直接用URLClassLo

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft