使用命令行提取.jar文件

编程入门 行业动态 更新时间:2024-10-27 11:24:04
本文介绍了使用命令行提取.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

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文件

本文发布于:2023-10-14 12:21:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1491044.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:命令行   文件   jar

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!