如何从jar文件获取Java主类 [英] How to get java main class from jar file
本文介绍了如何从jar文件获取Java主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个可执行jar,我想从此jar中知道Java main class
的名称
I have an executable jar and i want to know the name of java main class
from this jar
我的问题是是否有java cmd
可以从jar元数据中获取此信息?
My question are if there is a java cmd
to get this from jar metadata ?
推荐答案
您可以使用unix命令:
unzip -p XXX.jar META-INF/MANIFEST.MF
You can use unix command :
unzip -p XXX.jar META-INF/MANIFEST.MF
或者您可以使用jar逗号
jar tf XXX.jar
并查看MANIFEST.MF
的内容.
or you can use jar commad
jar tf XXX.jar
and see the content of MANIFEST.MF
.
这篇关于如何从jar文件获取Java主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文