可执行的 .jar - 适用于某些用户,但不适用于其他用户

发布于 2024-12-25 23:54:03 字数 324 浏览 1 评论 0 原文

我最近发布了一个 .jar 文件形式的应用程序(使用 Eclipse 的“导出可运行 Jar 文件”,使用 Java JRE 6 构建)。大多数用户能够双击该文件并使其正常运行,但少数用户报告双击该文件会导致 javaw 启动,然后立即退出(没有错误消息)。

我与一些用户进行了交谈,并引导他们完成了从命令行运行 .jar 的过程。遇到此问题的用户似乎会收到“未找到主类”错误,即使 .jar 具有 META-INF 文件夹,其中包含格式正确的 MANIFEST.MF 文件。

我能做些什么来确保程序正常运行吗?这个问题更有可能出现在我的程序中,还是在他们的 Java 环境中?

谢谢。

I recently released an application in the form of a .jar file (built using Eclipse's "Export Runnable Jar File", using Java JRE 6). Most users are able to double click the file and have it run properly, but a few have reported that double clicking the file causes javaw to start, and immediately exit (with no error message).

I have talked with a few users, and walked them through the process of running the .jar from the command line. The users with the issue seem to be getting "Main class not found" errors, even though the .jar has a META-INF folder with a properly formatted MANIFEST.MF file inside.

Is there anything I can do to insure the program will run properly? Is the issue more likely in my program, or in their Java environment?

Thank you.

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

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

发布评论

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

评论(1

愿得七秒忆 2025-01-01 23:54:03

JAR 是非可执行文件格式,其扩展名可能与 Java 无关。最好使用 Launch4jJSmooth 将 JAR 包装为可执行文件。这种方式使您的应用程序更加用户友好。

JAR is non-executable file format and its extension might be not associated with Java. Its better use open source tools like Launch4j or JSmooth to wrap your JAR as an executable file. This way makes your application more user friendly.

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