Java 尝试提取 jar 文件时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18052460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:05:18  来源:igfitidea点击:

Error while trying to extract jar file

javajar

提问by user1016179

I am trying to extract a jar file using the following command:

我正在尝试使用以下命令提取 jar 文件:

C:\Program Files\Java\jdk1.7.0_25\bin>jar xf C:\Users\...\MyJar.jar

but get the error:

但得到错误:

java.io.IOException: META-INF : could not create directory
    at sun.tools.jar.Main.extractFile(Main.java:953)
    at sun.tools.jar.Main.extract(Main.java:877)
    at sun.tools.jar.Main.run(Main.java:263)
    at sun.tools.jar.Main.main(Main.java:1177)

What can it be solved?

能解决什么问题?

采纳答案by Augusto

It's because you don't have write permissions in C:\Program Files\Java\jdk1.7.0_25\bin.

这是因为您没有C:\Program Files\Java\jdk1.7.0_25\bin.

Try uncompressing it in a different folder or open a console as administrator.

尝试将其解压缩到不同的文件夹中或以管理员身份打开控制台。

回答by Ankur Lathi

It looks like permission issue.

看起来像权限问题。

Try extracting the jar file using WinRAR or 7-zip. you can right click on jar file and select extract to (Where you have write permission) .

尝试使用 WinRAR 或 7-zip 解压缩 jar 文件。您可以右键单击 jar 文件并选择解压缩到(您有写权限的位置)。

回答by Shuhail Kadavath

Seems like its a permission issue . Please check that :

似乎是一个权限问题。请检查:

1) You have read/write permission in that folder you are trying to extract to . 2) The folder is write protected

1) 您在尝试解压缩到的文件夹中具有读/写权限。2) 文件夹被写保护

Try to copy that to a different directory and try to extract the jar .

尝试将其复制到其他目录并尝试解压缩 jar 。