5
I am trying to creat JAR file through eclipse. I read some of the threads from

stackoverflow 以及其他论坛。但没有任何帮助。

我已经创建了一个像这样的单独清单文件。

Manifest-Version: 1.0
Main-Class: Main
Class-Path: gnujaxp.jar iText-2.1.5.jar jcalendar.jar jcommon-1.0.16.jar jfreechart-1.0.13.jar jfreechart-1.0.13-experimental.jar jfreechart-1.0.13-swt.jar junit.jar servlet.jar swtgraphics2d.jar tinyos.jar

我已将所有这些罐子放在同一个项目文件夹中。

导出时我正在导出所有资源(也意味着这个 jar 文件。)

但是当我的应用程序尝试加载包含的任何一个 jar 时,我仍然收到 noclassdeffound 错误。

我哪里错了..

提前致谢。

4

3 回答 3

9

If you are using eclipse >=3.4 try "export as runnable jar file" it should generate it correctly.

Otherwhise you can provide your own manifest file in the export as jar dialog.

于 2010-04-14T09:20:20.643 回答
2

I get this error and find that my manifest needs a space after the jars in the class-path. This includes the ones at the end of the line and end of list, otherwise it mashes them together.

于 2012-01-12T22:49:09.767 回答
0

请务必在 Manifest 文件的末尾添加一个空行。

于 2015-05-04T15:29:02.947 回答