尽管在 MANIFEST.MF 中正确指定,但“找不到主类:bla.bla.yada”

发布于 2024-09-01 04:36:27 字数 208 浏览 1 评论 0原文

我尝试使用命令“java -jar Filename.jar”运行 .jar 文件,但总是收到错误消息“找不到主类:bla.bla.yada”。 我使用 Maven 构建整个应用程序,并在 MANIFEST.MF 中指定一个主类。文件中的路径是正确的,并且该类也存在于 jar 中的正确位置。

MANIFEST.MF 中省略了结尾的 .class。我希望这是正确的。您还有其他提示吗?

I'm trying to run a .jar file with the command "java -jar Filename.jar", but I am always getting an error saying "Could not find the main class: bla.bla.yada".
I build the whole application with Maven and specified a Main-Class in the MANIFEST.MF. The path in the file is correct and the class also exists at the right location in the jar.

The ending .class is omitted in the MANIFEST.MF. I hope this is correct. Do you have any other hints?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁的年少不轻狂 2024-09-08 04:36:27

当您运行 jar 时,请确保您的类路径中也包含所有必需的库。

Make sure that you also have all required libraries in your class path, when you run your jar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文