gpt4 book ai didi

java - jar -C 选项似乎不起作用

转载 作者:行者123 更新时间:2023-11-30 07:11:31 25 4
gpt4 key购买 nike

我正在使用命令

$ jar cvf a.jar -C ../bin/ ../bin/a.class ../bin/b.class

输出是:

adding: ../bin/a.class(in = 0) (out= 0)(stored 0%)
adding: b.class(in = 0) (out= 0)(stored 0%)

-C 选项不适用于第一个文件,但适用于第二个文件。可能是什么问题?

最佳答案

您似乎对命令行选项感到困惑。用法是:

Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...

-C change to the specified directory and include the following file

(注意 -C 选项的帮助中包含以下文件。)当你说:

jar cvf a.jar -C ../bin/ ../bin/a.class ../bin/b.class

它会查找 ../bin/../bin/a.class../bin/b.class,这会导致您观察到的行为.要么说:

jar cvf a.jar ../bin/a.class ../bin/b.class

jar cvf a.jar -C ../bin/ a.class -C ../bin/ ../bin/b.class

要包含 ../bin/ 目录中的所有文件,请说:

jar cvf a.jar -C ../bin/ .

关于java - jar -C 选项似乎不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21044898/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com