任何人都可以告诉我如何使用命令提示符将类文件添加到JAR文件中的特定包中。
示例:Test.jar的包装结构为com.test 现在我想在Test.jar文件的com.test包中添加一个名为Test.class的类文件。
我们非常感谢您的帮助。
答案 0 :(得分:2)
答案 1 :(得分:1)
jar uf jar-file input-file(s)
在此命令中:
The u option indicates that you want to update an existing JAR file.
The f option indicates that the JAR file to update is specified on the command line.
jar-file is the existing JAR file that's to be updated.
input-file(s) is a space-delimited list of one or more files that you want to add to the Jar file.
Any files already in the archive having the same pathname as a file being added will be overwritten.
参考:http://docs.oracle.com/javase/tutorial/deployment/jar/update.html