我最近发布了一个 .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.
发布评论
评论(1)
JAR 是非可执行文件格式,其扩展名可能与 Java 无关。最好使用 Launch4j 或 JSmooth 将 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.