你如何重新编译一个jar文件? [英] How do you recompile a jar file?

查看:556
本文介绍了你如何重新编译一个jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拿了一个旧的jar文件并进行了编辑。现在我有一个包含所有文件的文件夹,我想将它们重新编译回jar文件。我该怎么做?

I took an old jar file and edited it. Now i have a folder that has all the files and I want to recompile them back to a jar file. How do i do this?

推荐答案

Jar文件不是正常意义上的编译。但是你只需用 jar 命令创建一个:

Jar files aren't "compiled" in the normal sense of the word. But you just create one with the jar command:

jar cvf myfile.jar file1 file2 etc

您可以正常使用globbing:

You can use globbing as normal:

jar cvf ../myfile.jar *

运行 jar - ?或阅读 docs 以获取更多信息。

Run jar -? or read the docs for more information.

请注意,对于可执行jar文件,您需要指定清单文件也是。

Note that for an executable jar file, you'll need to specify the manifest file as well.

这篇关于你如何重新编译一个jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆