I'm trying to package an application in a jar file which uses some external libs.
When I specify a Class-Path in the manifest, i get a NoClassDefFoundError exception for my Main-Class. When I remove the Class-Path header, of course, I get a NoClassDefFoundError exception for one of the classes I've imported in that main class.
It seems as though if I specify a Class-Path, ONLY the jars listed there are on the classpath - no longer the packages in the jar itself.
What am i doing wrong? (I tried adding "." to the Class-Path - still doesn't work)
FYI - my package is at the root of the jar:
Please tell us some more details, eg your classpath, how you are setting it, and the contents of your manifest file.
Joined: Dec 14, 2004
Campbell Ritchie wrote:Please tell us some more details, eg your classpath, how you are setting it, and the contents of your manifest file.
well, i'm not setting any specific classpath outside of the manifest. here it is:
I'm using the <manifest> element of ant's <jar> task to create it. 2 strange things i'm noticing are
1. the hard line breaks. Why would it do that? I'm specifying them all in one attribute of the <attibute> node:
2. the non-system friendly paths (slashes wrong way, etc)
I would imagine both of these would cause classpath problems, but, regardless; i would think it would be tbe IMPORTED classes that can't be found. Why would this have any effect on my main class?