jar-The Java Archive Tool

遇到的问题-----The project contains another dependency with the same archive name maven工程有报错如下: Invalid classpath publish/export dependency D:/myeclipse/Common/binary/com.sun.java.jdk.win32.x86_64_1.6.0.013/lib/tools.jar. The project contains another dependency with the same a 阅读详情

jar-The Java Archive Tool

Combines multiple files into a single JAR archive file.

SYNOPSIS

jar [ options ] [manifest] destination input-file [input-files]

DESCRIPTION

The jar tool is a java application that combines multiple files into a single JAR archive file. jar is a general-purpose archiving and compression tool, based on ZIP and the ZLIB compression format. However, jar was designed mainly to facilitate the packaging of java applets or applications into a single archive. When the components of an applet or application (.class files, images and sounds) are combined into a single archive, they may be downloaded by a java agent (like a browser) in a single HTTP transaction, rather than requiring a new connection for each piece. This dramatically improves download times. <!-- REMIND: put a link to download benchmark statistics in here --> jar also compresses files and so further improves download time. In addition, it allows individual entries in a file to be signed by the applet author so that their origin can be authenticated. The syntax for the jar tool is almost identical to the syntax for the tar command.

The 3 types of input files for the jar tool are

  • manifest file (optional)
  • destination jar file
  • files to be archived

Typical usage is

	% jar cf myjarfile *.class 
In this example, all the class files in the current directory are placed into the file named "myjarfile". A manifest file is automatically generated by the jar tool and is always the first entry in the jar file. By default, it is named META-INF/MANIFEST.INF. The manifest file is the place where any meta-information about the archive is stored. Refer to the manifest specification for details about how meta-information is stored in the manifest file.

If you have a pre-existing manifest file that you want the jar tool to use for the new jar archive, you can specify it using the -m option:

	% jar cmf myManifestFile myJarFile *.class

When files are added to a jar archive, the file and its MD5 and SHA hashes are stored. The hashes are entered into the manifest file. It is easy to view and process the contents of the manifest file, since it uses RFC822 ascii format.

OPTIONS

c
Creates a new or empty archive on the standard output.

t
Lists the table of contents from standard output.

x file
Extracts all files, or just the named files, from standard input. If file is omitted, then all files are extracted; otherwise, only the specified file or files are extracted.

f
The second argument specifies a jar file to process. In the case of creation, this refers to the name of the jar file to be created (instead of on stdout). For table or xtract, the second argument identifies the jar file to be listed or extracted.

v
Generates verbose output on stderr.

m
Includes manifest information from specified pre-existing manifest file. Example use:
jar cmf myManifestFile myJarFile *.class
You can add special-purpose name-value attribute headers to the manifest file that aren't contained in the default manifest. Examples of such headers would be those for vendor information, version information, and package sealing. See the JAR Files trail in the Java Tutorial for examples of using the m option.

0
Store only, without using ZIP compression.

M
Do not create a manifest file for the entries.

If any of "files" is a directory, then that directory is processed recursively.

EXAMPLES

To add all the files in a particular directory to an archive:

C:/WWWROOT/JAVA> ls
12/09/96  12:20a        <DIR>          .    
12/09/96  12:17a        <DIR>          ..  
12/09/96  12:18a                 1,010 0.au
12/09/96  12:18a                   946 1.au
12/09/96  12:18a                 1,039 2.au
12/09/96  12:18a                   993 3.au
12/09/96  12:18a                 1,006 4.au
12/09/96  12:18a                 1,016 5.au
12/09/96  12:18a                 1,048 6.au
12/09/96  12:18a                   980 7.au
12/09/96  12:18a                 1,064 8.au
12/09/96  12:18a                   989 9.au  
12/09/96  12:19a                48,072 spacemusic.au
12/09/96  12:19a                   527 at_work.gif
12/09/96  12:19a                12,818 monkey.jpg
12/09/96  12:19a                16,242 Animator.class
12/09/96  12:20a                 3,368 Wave.class
              17 File(s)         91,118 bytes
                            414,983,168 bytes free

C:/WWWROOT/JAVA> jar cvf bundle.jar *
adding: 0.au
adding: 1.au
adding: 2.au
adding: 3.au
adding: 4.au
adding: 5.au
adding: 6.au
adding: 7.au
adding: 8.au
adding: 9.au
adding: Animator.class
adding: Wave.class
adding: at_work.gif
adding: monkey.jpg
adding: spacemusic.au
C:/WWWROOT/JAVA>
If already have subdirectories for images, audio files and classes in my html directory, I might jar up each directory into a single jar file:
C:/WWWROOT/JAVA> DIR
12/09/96  12:11a        <DIR>          .
12/09/96  12:17a        <DIR>          ..
12/03/96  06:54p        <DIR>          audio
12/06/96  02:02p        <DIR>          images
12/09/96  12:10a        <DIR>          classes
               6 File(s)        207,360 bytes
                            414,983,168 bytes free

C:/WWWROOT/JAVA> jar cvf bundle.jar audio classes images
adding: audio/1.au
adding: audio/2.au
adding: audio/3.au
adding: audio/spacemusic.au
adding: classes/Animator.class
adding: classes/Wave.class
adding: images/monkey.jpg
adding: images/at_work.gif
C:/WWWROOT/JAVA/Animator> dir
12/09/96  12:11a        <DIR>          .
12/09/96  12:17a        <DIR>          ..
12/09/96  12:11a               207,360 bundle.tar
12/03/96  06:54p        <DIR>          audio
12/06/96  02:02p        <DIR>          images
12/09/96  12:10a        <DIR>          classes
               6 File(s)        207,360 bytes
                            414,983,168 bytes free

C:/WWWROOT/JAVA/Animator> 
I can then see the entry names in the jarfile using the jar tool and the "t" option:
C:/WWWROOT/JAVA/Animator> jar tf bundle.jar
META-INF/MANIFEST.MF
audio/1.au
audio/2.au
audio/3.au
audio/spacemusic.au
classes/Animator.class
classes/Wave.class
images/monkey.jpg
images/at_work.gif
C:/WWWROOT/JAVA/Animator> 
Enumerating verbosely (with the "v" option) will tell me more information about the files in the archive, such as their size and last modified date:
C:/WWWROOT/JAVA/Animator> jar tvf bundle.jar
   145 Thu Aug 01 22:27:00 PDT 1996 META-INF/MANIFEST.MF
   946 Thu Aug 01 22:24:22 PDT 1996 audio/1.au
  1039 Thu Aug 01 22:24:22 PDT 1996 audio/2.au
   993 Thu Aug 01 22:24:22 PDT 1996 audio/3.au
 48072 Thu Aug 01 22:24:23 PDT 1996 audio/spacemusic.au
 16711 Thu Aug 01 22:25:50 PDT 1996 classes/Animator.class
  3368 Thu Aug 01 22:26:02 PDT 1996 classes/Wave.class
 12809 Thu Aug 01 22:24:48 PDT 1996 images/monkey.jpg
   527 Thu Aug 01 22:25:20 PDT 1996 images/at_work.gif
C:/WWWROOT/JAVA/Animator>
Java Archive Downloads - Java SE 6 JDK6 Java Archive Downloads - Java SE 6 立即下载

相关推荐

Labview执行adbshell操作

一、目录 1、实现思路 2、adbshell工具配置 3、Labview执行命令窗口 1、实现思路 使用Labview的优点: 1、可以配合电源系统或者调用其他接口工具实现更高程度的自动化测试; 2、直接执行Linux相关命令,编写相关执行顺序或者逻辑更简易; --------可以用adbpush命令将.sh的脚本文件推入控制器内部执行; 3、Ubuntu系统比较大,如果只是日常执行脚本测试还是比较占用磁盘空间; 2、adbshell工具配置 1)下载adbshell工具; adbshell工具下载链

zataji的博客 2055

jar-The Java Archive Tool (转)

jar-The Java Archive Tool (转)[@more@]jar-The Java Archive Tool Combines multiple files into a single JAR archive ...

csd3176的博客 232

AutoGenTestCase - AI大模型生成测试用例

AI技术助力高效软件测试:AutoGenTestCase工具介绍 传统手工测试存在效率低、覆盖不全等痛点。AutoGenTestCase工具集成DeepSeek、通义千问等AI大模型,能快速解析需求并自动生成标准化测试用例,将数小时工作缩短至分钟级。该工具部署简单,仅需配置APIKey即可运行,支持多种测试用例类型比例设置,并输出Markdown和Excel格式的测试用例。通过GitHub或网盘下载后,用户可按照教程完成APIKey配置、需求文档上传和用例生成等操作,显著提升测试效率与覆盖完整性。

YIqifeibaQI的博客 351

【软件工具】Java语言编译成JAR(Java Archive)文件工具、工作原理简介

这是一个基本的例子,实际项目中可能需要包括多个类文件和资源。在更复杂的情况下,可以使用构建工具(如Maven或Gradle)来自动化编译和打包过程。这些工具提供了更高级的功能,如依赖管理和自动化构建流程。Maven是一个强大的构建工具,广泛用于Java项目的构建管理。它简化了构建过程,同时提供了项目管理和依赖管理的功能。,Maven就可以处理大部分的构建任务,使开发过程更加高效和可靠。Maven的强大功能在于它的自动化和标准化。假设我们有一个简单的Java项目,包含一个主类。工具的工作原理和一个使用例子。

weixin_46453070的博客 2238

rk3576之imx415 4k@60fps

1;0;1;0;1;0;1;0;1;0;1;0;1;0;

darennet的专栏 705

3D打印机新手必看:VSCode+PlatformIO搭建Marlin固件编译环境(附常见错误解决)

本文为3D打印机新手详细介绍了如何使用Visual Studio Code和PlatformIO搭建Marlin固件编译环境。内容涵盖从软件安装、源码配置到编译实战的全流程,并重点解析了依赖冲突、内存不足等高频错误的解决方案,帮助用户快速上手并成功编译自定义固件。

j2k3l4的博客 705

Java 常用工具类(30) : File工具类

import com.github.junrar.Archive; import com.github.junrar.rarfile.FileHeader; import org.apache.commons.compress.archivers.ArchiveException; import org.apache.commons.compress.archivers.ArchiveInpu...

Lxinccode的博客 1417

详解Numpy中的transpose方法

最近在学Numpy碰到了关于数组转置和换轴的概念,尤其是对tanspose方法有些疑惑,尤其是多维,查了不少资料,终于搞懂了。 Numpy数组的轴(axis) 所谓的**轴(axis)**可以理解为数组的维度。 具体而言,二维数组就是有两个维度,如果从空间上看,它就是一个平面,由x轴和y轴构成,而与此相对应的,该二维数组就有两个轴,x轴对应0轴,y轴对应1轴。 同理,三维数组有三个维度,空间上...

BlankGrid的博客 940

【Java之JAR包解析】(一)如果你也跟我一样搞懂了rt.jar,那真的泰裤辣! · 上篇~

JAR (Java ARchive) 是一种 Java 打包文件格式,它可以将一组 Java 类文件、相关资源和元数据打包到一个单独的文件中。JAR 文件通常用于分发 Java 应用程序或库,并且可以在不同平台上运行。 JAR 包是一种方便的方式来组织和管理 Java 代码和依赖项,并且可以轻松地与其他开发人员共享和部署代码。JAR 包还支持数字签名和版本控制,以确保代码的完整性和安全性。 进入Java的安装路径下的 jre\lib 目录,就可以看到 JRE环境所依赖的一些JAR包:rt.jar包...

Technology changes the world of life 1万+

使用 Python 实现基于 AGA8 GERG - 2008 方程计算掺氢天然气压缩因子的示例代码

AGA8 GERG - 2008 方程是用于计算天然气混合物热力学性质的一种方法,下面是一个使用 Python 实现基于 AGA8 GERG - 2008 方程计算掺氢天然气压缩因子的示例代码。需要注意的是,AGA8 GERG - 2008 方程非常复杂,完整实现需要大量的系数和详细的计算步骤。这里我们简化了部分过程,使用CoolProp库来完成计算,因为CoolProp已经实现了 GERG - 2008 方程。

AI的内部世界的博客 889

Allegro快速编辑丝印文字操作指导

选择setup-Application Mode-placement edit。Allegro支持丝印文字的编辑,下面介绍快速编辑丝印文字的两种方法如下。这个功能还支持拷贝粘贴,可以从其它地方拷贝过来,免去了书写的麻烦。出现text edit窗口,输入自己需要的文字,点击ok。鼠标移动到丝印文字位置,文字会被高亮起来。Allegro快速编辑丝印文字操作指导。点击丝印文字,丝印会被高亮起来。选择Text edit 命令。输入需要更改后的文字,如下。右击选择text edit。以编辑下方丝印文字为例。

weixin_54787054的博客 4194

转载 Jar(Java Archive)Java 文件归档

JAR(Java ARchive,Java 归档)是一种与平台无关的文件格式,可将多个文件合成一个文件。用户可将多个 Java applet 及其所需组件(.class 文件、图像和声音)绑定到 JAR 文件中,而后作为单个的简单 HTTP(Hypertext Tranfer Protocal,超文本传输协议)事务下载到浏览器中,从而大大提高下载速度。JAR 格式也支持压缩,从而减小了文件的大小,进一步缩短下载时间。另外,applet 编写者也可在 JAR 文件中用数字签名的方式签写各项以确认其来源。它用

Myblog 573

uniapp | vue2 | vue3 - 解决调用天地图功能服务时 http 网络请求报错 net::ERR ABORTED 503(Service Temporarily Unavailabl)

vue,uni-app,天地图,请求报错,503,请求失败,map.tianditu,天地图503,天地图请求503,接口503错误怎么办,vue天地图,uniAPP天地图,获取定位接口服务器报错503,获取当前定位,定位功能,IP属地定位,天地图服务器报错,如何解决报错,net::ERRABORTED503(ServiceTemporarilyUnavailabl),GET,POST,服务暂时不可用,react天地图,一直等待吗,报错怎么办,定位报错,轨迹,经纬度,天地图服务器503,在vue2

🏆 前端领域优质创作者 4440

Java存档工具(JAR)示例

这是项目结构。 /workspace/test/classes/com/mkyong/awt/AwtExample.class /workspace/test/classes/com/mkyong/awt/AwtExample2.class /workspace/test/classes/com/mkyong/awt/AwtExample3.class /workspace/test/cla...

一名可爱的技术搬运工 460

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Java tutorial学习笔记——JAR文件

概述 通常情况下,jar文件中包含有class文件、程序关联的资源文件。 安全,开发者可以对jar文件进行数字签名,识别签名的用户获得安全权限。 压缩 包扩展,添加功能给java核心平台。 包密封,将一个package下的所有class文件打包进同一个jar文件下。     使用JAR文件 JAR文件使用ZIP文件格式打包 JDK已经提供了Java Archive Tool,用...

小黑王HK 350

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

Java JDK 常用工具命令 javac、jar、java、javaw,替换 .jar 包 class 文件,脚本启停 spring boot Jar 包服务

目录 javac.exe 编译 jar.exe 打包 java.exe 执行 javaw.exe 命令 javac.exe 编译 1、编写的 Java 源文件执行之前都需要使用 javac.exe 命令进行编译,即 *.java 编译成 *.class。 2、javac.exe 在 %JAVA_HOME%/bin 目录下,配置好环境变量后,命令行中可以直接运行。命令行中输入 java...

蚩尤后裔-汪茂雄 4960

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Eclipse下启动tomcat报错:/bin/tool.jar which is referenced by the classpath, does not exist.

1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: D:/Program Files/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist. 2.原因: 这是因为我中途移动

zhouzhiwengang的专栏 6534

jar 工具

为了用 JAR 文件执行基本的任务,要使用作为 Java Development Kit 的一部分提供的 Java Archive Tool ( jar工具 )。用 jar命令调用 jar工具。表 1 显示了一些常见的应用: 表 1. 常见的 jar工具用法 功能 命令 用一个单独的文件创建一个 JAR 文件 jar cf jar-file input-file... ...

悠悠我心 152

Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.

在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist.解决办法:1.双击servers选项下的tomcat,打开如下界面:然后点击...

wolovedaima123的博客 2095

Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is refere

1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist. 2.原因: 这是因为我中途移动过

水土不服的博客 8386

The archive: F:/soft/java/jdk-8u31-windows-x64/lib/tools.jar which is referenced by the classpath,

解决: The archive: F:/soft/java/jdk-8u31-windows-x64/lib/tools.jar which is referenced by the classpath, 参考链接 http://blog.youkuaiyun.com/jimoshuicao/article/details/52664067?locationNum=4&fps=1地址

shursulei的博客 1541

eclipse启动tomcat jar不存在

1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist. 2.原因: 这是因为我中途移动过

Richard_Stevin的博客 920

Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist....

1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist. 2.原因: 这是因为我中途移动过tomcat的位置的...

weixin_30385925的博客 440

The archive: D:/Program Files (x86)/apache-tomcat-6.0.39/bin/bootstrap.jar w

1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by the classpath, doesnot exist. 2.原因: 这是因为我中途移动过tomcat的位置的...

weixin_33778778的博客 109

【转】Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist....

转载地址:http://blog.youkuaiyun.com/jnqqls/article/details/8946964 1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动tomcat报错:The archive: C:/Program Files(x86)/Java/jdk1.7.0_10/lib/tools.jar which is referenced by th...

weixin_30906671的博客 176
上一篇: Drag and Drop: New Data Transfer Capabilities in the JavaTM 2 Platform, Standard Edition (J2SETM), version 1.4
下一篇: Getting Listeners from JavaBeansTM
CanFly
博客等级 码龄25年 0粉丝 18原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值