Creating Jar file - doesn't work on other computers

只愿长相守 提交于 2019-12-05 07:44:59

This is a very strange bug which I've also encountered.

Assuming you are using JRE 1.7,
The only fix I found to this problem was to change the project's JRE version from 1.7 down to 1.6.

Edit: I've also encountered this error on computers with JVM 7.

I believe it is because you try to specify a class file from the default package for the Main-Class attribute. JAR files and default packages don't really mix well. I would advise to put your whole project into a simple package (as far as I saw from the attached JAR file you use only the default package).

Also, try to adopt to the common Java conventions (its hard to tell what is a class and first I thought there is some package-specific error, i.e., use Start instead of start as a classname).

Another common issue is that the last line of the MANIFEST.MF file is uninterpreted, as stated in the Java tutorial:

Warning:

The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!