I have repetitively checked my manifest, libraries and project properties yet my simple runnable jar keeps present the error that the main class is unable to be found. I have attached a link to the source files and project folder, which includes the jar file. https://drive.google.com/file/d/0B54ZddoX54HbcnZjQkY3ZXRBajg/edit?usp=sharing
问问题
42 次
2 回答
1
您发布的 manifest.mf 文件如下所示:
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
为了让java知道你的主类是什么,你必须告诉它。像这样:
Manifest-Version: 1.0
Main-Class: com.foo.bar.MainClass
于 2013-10-30T16:43:25.757 回答
1
清单文件区分大小写。它应该是MANIFEST.MF
在构建后确认您的 jar 包含该文件,其中定义了 Main-Class。
于 2013-10-30T16:43:35.450 回答