Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
任何可以在不解压文件的情况下打开文件的 OS X ZIP 实用程序都可以。或者,打开终端窗口并键入:
您可以将文件从 Finder 拖到终端窗口,它会为您填充文件名。您还可以将输出通过管道传输到 less 中以上下滚动。
Any OS X ZIP utility that can open files without unpacking them will do. Alternatively, open a terminal window and type:
You can drag the file from Finder to the Terminal window, and it will populate the filename for you. You can also pipe the output into less to scroll up and down.
我将其复制到“.zip”文件,然后使用我的 zip 实用程序查看内部。
.ear
、.war
和.jar
只是 zip 文件,其中包含其他必需的项目。如果您想提取内容,可以解压它们。 Java 包含一个
jar
命令,该命令提供压缩/解压缩档案的能力(以及额外验证档案是否正确的 jar 文件)。I copy it to a ".zip" file and then use my zip utilities to peek inside.
.ear
s,.war
s, and.jar
s are just zip files with additional required items packed inside.If you want to extract the contents, you can unzip them. Java contains a
jar
command that provides ability to zip / unzip the archives (and extra verifications that the archives are properly jar files).您可能还想尝试一下 Jarzilla。
You may also want to give Jarzilla a try.
如果您还不能执行此操作,请确保您可以看到 *.jar 上的文件扩展名。将名称更改为 *.zip,这样您就可以像 ZIP 文件一样打开该文件(确实如此)。当您使用完 *.class 文件后,将其更改回 *.jar,以便您可以执行该文件。
尽管这有点乏味,但它不需要安装任何新程序,因此可以在任何计算机上完成,无论是否具有管理员权限。
If you can't already do it, make sure you can see the file extension on the *.jar. Change the name to *.zip, which will allow you to open the file as if it were a ZIP file (which it is). When you're done playing with the *.class files, change it back to *.jar so you can execute the file.
Although this is somewhat tedious, it doesn't require any new program installations and thus can be done on any computer, with or without admin rights.