How to set classpath in manifest file when creating JAR from eclipse?

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

stackoverflow, as well as other forums. But nothing helps.

I created a separate manifest file similar to this.

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

I put all these banks in one project folder.

When exporting, I export all resources (these are also jar files).

But still, I get a noclassdeffound error when my application tries to load any jar included.

Wrong somewhere ...

Thanks in advance.

+5
source share
3 answers

If you use eclipse> = 3.4, try "export as jar executable", it should generate it correctly.

, jar.

+9

, manifest class-path. , , .

+2

Be sure to add an empty line at the end of the manifest file.

0
source

All Articles