Linux下无需解压和压缩查看,添加,删除jar包内文件

2022-05-26  本文已影响0人  mtinsky

查看

jar tf abc.jar

t:列出档案目录

f:指定档案文件名

添加

使用zip命令,将lib/fastjson-1.2.83.jar加入abc.jar内

zip -ur0 abc.jar lib/fastjson-1.2.83.jar

u:update: only changed or new files

r:recurse into directories

0:store only

删除

使用zip命令,将abc.jar内的lib/fastjson-1.2.82.jar删除

zip -d abc.jar lib/fastjson-1.2.82.jar

参考链接:

https://www.jianshu.com/p/9efc96b3057a

https://www.cnblogs.com/grey-wolf/p/11291379.html

https://blog.csdn.net/xiligey1/article/details/82457140

https://stackoverflow.com/questions/4520822/is-there-a-quick-way-to-delete-a-file-from-a-jar-war-without-having-to-extract

上一篇 下一篇

猜你喜欢

热点阅读