How to create a .jar file that actually runs?

扶醉桌前 提交于 2019-12-02 07:11:28

问题


I am having lots of trouble with Creating a .jar file. every time i try to create one it, an error window pops up and says that the main class Start can not be found. (My main class is named Start) I have a manifest and everything can you tell me what i'm doing wrong please, or tell me what do do exactly? This can be from the command prompt or from eclipse as well!

Also sometimes a command prompt window pops up for a millisecond then closes in an instant!

My manifest says:

Manifest-Version: 1.0
Main-Class: Start

My main class is Start.class


回答1:


Here's my vague answer to your vague problem. It can be a variety of things. But the most probable one is than you have declared the Start class inside a package and didn't put the fully qualified class name in the manifest.

Assuming the package you have declared Start class in is foo.bar.lazy you need to give Main-Class: foo.bar.lazy.Start.



来源:https://stackoverflow.com/questions/10670767/how-to-create-a-jar-file-that-actually-runs

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