如何在没有MANIFEST.MF的情况下运行Java .jar? [英] How to run Java .jar without MANIFEST.MF?

查看:703
本文介绍了如何在没有MANIFEST.MF的情况下运行Java .jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以运行不包含 MANIFEST.MF 文件的Java应用程序?当然,有静态方法,只缺少清单文件。该应用程序取决于几个外部 .jar 文件。

Is it possible to run a Java app which doesn't contain MANIFEST.MF file? Of course, there's static main method,just lacks manifest file. And the app is depending on several external .jar files.

如果这可能,该怎么做?

If is this possible, how to do that?

推荐答案

有可能,您可以从命令行指定要运行的类:

It is possible, you can specify the class to run from the command line:

java -cp yourJar.jar your.main.Class

同样的问题:

如何从Jar运行一个类,它不是Manifest文件中的Main-Class

这篇关于如何在没有MANIFEST.MF的情况下运行Java .jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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