我正在尝试从.jar文件中提取文件。如何使用命令行执行此操作?
I am trying to extract the files from a .jar file. How do I do that using command line?
我正在运行Windows 7
I am running Windows 7
推荐答案来自文档:
要从jar文件中提取文件,请使用 x ,如下所示: C:\Java> jar xf myFile.jar
要从jar文件中仅提取某些文件,请提供其文件名:
To extract only certain files from a jar file, supply their filenames:
C:\Java> jar xf myFile.jar foo bar
jar 可能不是 C:\ Java 对于你,在我的Windows分区上它是:
The folder where jar is probably isn't C:\Java for you, on my Windows partition it's:
C:\Program Files (x86)\Java\jdk[some_version_here]\bin除非 jar 的位置在您的路径环境变量中,否则您必须指定完整路径/从文件夹内运行程序。
Unless the location of jar is in your path environment variable, you'll have to specify the full path/run the program from inside the folder.
编辑:这是另一篇文章,特别关注提取JAR: docs.oracle/javase/tutorial/deployment/jar/unpack.html
Here's another article, specifically focussed on extracting JARs: docs.oracle/javase/tutorial/deployment/jar/unpack.html
更多推荐
使用命令行提取.jar文件
发布评论