【编译jar文件】-- 中文看不懂啊,来篇英文的

本文详细介绍了如何创建、查看、提取、修改和更新JAR文件的基本操作,涵盖了使用jarc和jar命令的不同参数和选项。

  jar基本操作:   

  1. 创建jar文件  


  jar cf jar-file input-file(s)
  c---want to Create a JAR file.
  f---want the output to go to a file rather than to stdout.
  eg: 1)jar cf myjar.jar query_maintain_insert.htm
  2)jar cvf myjar.jar query_maintain_insert.htm
  v---Produces verbose(详细的) output. 

  3)jar cvf myjar.jar query_maintain_insert.htm mydirectory
  4)jar cv0f myjar.jar query_maintain_insert.htm mydirectory
  0---don't want the JAR file to be compressed.
  5)jar cmf MANIFEST.MF myjar.jar yahh.txt
  m---Used to include manifest information from an existing manifest file.
  6)jar cMf MANIFEST.MF myjar.jar yahh.txt
  M---the default manifest file should not be produced.
  7)jar cvf myjar.jar *
  *---create all contents in current directory. 
 

  2. 察看jar文件   


  jar tf jar-file
  t---want to view the Table of contents of the JAR file.
  eg: 1)jar vft yahh.jar
  v---Produces verbose(详细的) output.  

  3. 提取jar文件  


  jar xf jar-file [archived-file(s)]
  x---want to extract files from the JAR archive.
  eg: 1)jar xf yahh.jar yahh.txt(仅提取文件yahh.txt)

  2)jar xf yahh.jar alex/yahhalex.txt(仅提取目录alex下的文件yahhalex.txt)  

  3)jar xf yahh.jar(提取该jar包中的所有文件或目录)  
 

  4. 修改Manifest文件  


  jar cmf manifest-addition jar-file input-file(s)
  m---Used to include manifest information from an existing manifest file.  

  5. 更新jar文件  


  jar uf jar-file input-file(s)
  u---want to update an existing JAR file.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值