使用命令行提取.jar文件 [英] Extracting .jar file with command line

查看:678
本文介绍了使用命令行提取.jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从.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


<$ c的文件夹$ c> 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: http://docs.oracle.com/javase/tutorial/deployment/jar/unpack.html

Here's another article, specifically focussed on extracting JARs: http://docs.oracle.com/javase/tutorial/deployment/jar/unpack.html

这篇关于使用命令行提取.jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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