问题
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