在一个命令中提取几个jar
一个简单的solution.-获取所有的罐子和提取它
find ./ -name "*.jar" -exec jar -xf {} \;
你可以使用这个在所有的罐子的文件夹 -
jar {ctxu}[vfm0Mi] [jar-file] [manifest-file] [-C dir]
选项:
-c create new archive
-t list table of contents for archive
-x extract named (or all) files from archive
-u update existing archive
-v generate verbose output on standard output
-f specify archive file name
-m include manifest information from specified manifest file
-0 store only; use no ZIP compression
-M do not create a manifest file for the entries
-i generate index information for the specified jar files
-C change to the specified directory and include the following file
请参考说明文档以解释 - http://docs.oracle.com/javase/tutorial/deployment/jar/unpack.html
您可以将用户的* .jar到位JAR文件的提取所有
这应该在同一位置的罐子都存在提取。
jar xvf *.jar
我应该在[archived-file(s)]中放什么? –
其可选参数。 文档状态 - 归档文件是一个可选参数,由从归档文件中提取的文件的空格分隔列表组成。如果此参数不存在,则Jar工具将提取存档中的所有文件。 –
它工作了吗? @RaynD –
嗨,谢谢。即时通讯和错误,我应该在cli的根文件夹? –
没有必要。你必须在同一个文件夹中,罐子可用。还有你得到什么错误? – nagendra547
im在包含jar列表的文件夹中的终端并获取此错误java.io.FileNotFoundException :(无此文件或目录) at java.io.FileInputStream.open0(Native Method) –