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 立即下载

相关推荐

RC滤波电路工作原理:【带图+公式计算】

容抗Xc和电容C成反比,和频率f也成反比,C越大,交流电容易通过电容,说明电容量大,电容的阻碍作用小;交流电的频率高,交流电也容易通过电容,说明频率高,电容的阻碍作用也小。我们可以看到,一个2V的纹波,经常RC电路后,幅值下降到mv级别,基本可以忽略不计,这就是RC滤波电路的工作原理。一个频率为1Khz的信号,通过一个容值为0.1uf的电容,计算电容对该信号产生的阻抗。将RC滤波器电路中的电阻,取值为1KΩ,电容取值为0.47uf,纹波幅值为2V。从公式1可以看到,Xc越大,Vout值就越接近Vin的值。

weixin_66299220的博客 2万+

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

高通410刷OpenWRT后网络共享配置全攻略

本文详细解析了在高通410设备刷入OpenWRT后,因基带文件丢失导致无法上网的常见问题。核心解决方案是通过SMB网络共享,将备份的原厂基带文件传输至OpenWRT系统并正确还原,从而恢复移动网络连接。文章提供了从备份基带、刷机到配置共享和文件替换的完整操作指南。

grafana6viz的博客 572

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

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

weixin_46453070的博客 2238

Python实战:用MOOTDX库轻松抓取股票分时数据并绘制专业图表(附完整代码)

本文详细介绍了如何使用Python的MOOTDX库获取股票分时数据,并通过Pandas进行数据清洗与VWAP计算,最后利用Matplotlib绘制包含价格线、均线和成交量的专业分时图。文章提供了从环境搭建、数据获取到可视化呈现的完整代码,帮助读者快速构建本地化的股票分时数据分析工具。

weixin_29041195的博客 478

手把手教你调试RTL8201F:从芯片手册解读到LWIP驱动移植

本文详细解析了RTL8201F PHY芯片的开发流程,从寄存器配置到LWIP驱动移植,重点介绍了RMII模式下的特殊配置要点和调试技巧。通过实战案例和高级调试方法,帮助工程师解决网络性能问题,实现与FreeRTOS+LWIP协议栈的稳定集成。

ik678901234的博客 973

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

2021年全国职业院校技能大赛高职组网络系统管理赛项

S1 Ruijie(config)#switch virtual domain 1 Ruijie(config-vs-domain)#switch 1 Ruijie(config-vs-domain)#switch 1 priority 150 Ruijie(config-vs-domain)#switch 1 description S1 Ruijie(config-vs-domain)#exit Ruijie(config)#vsl-port Ruijie(config-vsl-port)#po

bfq05234214的博客 1136

【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万+

【算能】TPU 指令集架构深度解析

TPU指令集以领域专用性与数据流驱动为核心,通过精简指令集、硬件固化逻辑与高并行架构,实现张量计算的极致性能。开发者通常无需直接编写指令,但理解其设计原理对性能调优(如内存布局优化、指令调度)至关重要。算能TPU通过开放指令描述与编译器工具链,为垂直行业提供了更高灵活性的定制空间,而谷歌TPU则依赖编译器的全自动化优化,更适合大规模标准模型部署。未来,随着稀疏计算、光子计算等技术的引入,TPU指令集将进一步向高能效与高泛化性演进。

浩瀚之水的专栏 1183

ESP32-S3驱动OV3660摄像头原理图设计,已量产

本文重点拆四条主线:多来源输入电源如何收敛到 3V3,摄像头三路供电如何拆分,ESP32-S3 如何接住 DVP 数据流与外部存储,以及音频/补光/传感外围怎样挂到主控边上。至于最终图像帧率、算法策略和软件时序,当前原理图未体现。

不脱发的程序猿 987

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

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

Myblog 573

【agent实战教程】OpenClaw多个agent一文通

一个合格的独立agent,必须具备6个完全独立的专属组件独立组件路径规则核心要求不独立的严重后果唯一agentId配置文件中全局唯一,不能重复,建议用英文+数字,不要有特殊字符agent配置冲突,消息派单错误,会话串线独立工作区(workspace)建议每个agent一个独立文件夹,不要共用人设、记忆、规则混在一起,agent人设崩塌,对话串线独立状态目录(agentDir)固定系统自动生成,绝对禁止多个agent复用同一个agentDir。

海兰 651

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

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Java tutorial学习笔记——JAR文件

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

小黑王HK 350

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

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

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

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、付费专栏及课程。

余额充值