使用 JAVA 从 jar 文件中读取 MANIFEST.MF 文件 [英] reading MANIFEST.MF file from jar file using JAVA

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

问题描述

有什么方法可以读取 jar 文件的内容.就像我想阅读清单文件以找到 jar 文件和版本的创建者一样.有什么办法可以达到同样的效果.

Is there any way i can read the contents of a jar file. like i want to read the manifest file in order to find the creator of the jar file and version. Is there any way to achieve the same.

推荐答案

接下来的代码应该会有所帮助:

Next code should help:

JarInputStream jarStream = new JarInputStream(stream);
Manifest mf = jarStream.getManifest();

异常处理留给你:)

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

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