1

我正在使用 jar -uf 来更新我的 MANIFEST.MF 文件,如下所示:

一个。jar xf jarfile.jar META-INF\MANIFEST.MF

湾。编辑文件

C。jar uf jarfile.jar META-INF\MANIFEST.MF

但是“uf”命令正在从我的 jar 中删除 MANIFEST.MF。更改 jar 内文件的正确方法是什么(windows 7,jdk 1.6)?

4

3 回答 3

1

为了更新清单文件,jar 命令提供了不同的选项 -

jar umf manifest jar-file
The m option indicates that you want to update the JAR file's manifest.
manifest is the manifest whose contents you want to merge into the manifest of the existing JAR file.

例子@http://java.sun.com/developer/Books/javaprogramming/JAR/basics/update.html

于 2011-10-05T20:30:27.987 回答
1

您始终可以使用 winrar(或任何等效项)打开 jar,然后拖放文件。为我工作。

于 2011-10-05T20:24:07.790 回答
0

清单文件有一个特殊选项 (m):http: //download.oracle.com/javase/1.4.2/docs/tooldocs/windows/jar.html

你能试试吗

jar um jarfile.jar META-INF/MANIFEST.MF
于 2011-10-05T20:30:02.137 回答