开发者

Java "Could not find main class" blah blah blah, but something strange:

So. I compile a .jar file. I know I have the Manifest correct. The main class is called "Boot." Whenever I try to run the .jar, I get the following error: Could not find the main class: <classdir>.Boot. Program will exit. I have no idea what is causing it. Also, I found something strange: If I open the file with 7-zip (alternative to WinZip) and navigate to the 开发者_如何学Pythonmain class, there isn't a file called Boot.class. There are two files: Application.class and Application$1.class. Does anyone have an idea as to what is happening and how to fix? :\

EDIT I just realized that there was another .java in the directory as Boot.java was called Aplication.java. So I guess Boot.java just isn't getting compiled? :\


You should check if any of these work:

  • "java -jar your.jar Boot"
  • unpack the jar file (any unzip will work), cd into the root folder, and run it with "java Boot"

This will tell you if the Manifest was wrong or the Boot.java wasn't there. Then fix as appropriate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜