jar中的更新文件创建绝对路径,找不到指定的路径

时间:2019-02-21 17:37:37

标签: java jar archive

我一直在为此绞尽脑汁。我想替换一个jar中的图像文件。该图像位于images / logo.png中(根据jar tf)。我使用“ jar vfu test.jar images /”来更新文件。输出...

jar vfu test.jar images/
adding: images/(in = 0) (out= 0)(stored 0%)
adding: images/logo.png(in = 2435) (out= 2419)(deflated 0%)

如果我从该位置运行jar,则更新有效,我会看到新徽标。但是,当我尝试从更新位置以外的其他位置运行jar时,出现文件找不到异常,显示图像的绝对路径:c:\ temp \ images \ logo.png。

java.io.FileNotFoundException: C:\temp\images\logo.png (The system cannot find the path specified)

我在这里做什么错了?

0 个答案:

没有答案
相关问题