I have one jar file that needs to refer some of the files from xerces.jar. I know that we cannot include a jar within a jar. The other way is to have a manifest file. But the problem I am facing while using the manifest file is when I place both the jar in same folders than everything works but if i put them in different folders or drives (D:some.jar and c:xerces.jar) than I get classnotfound exception. Can someone please tell me how should I refer a jar from another jar.
The Class-Path entry in the manifest should contain the path of the referred-to jar file relative to the jar file that contains the manifest.
So, if you go to the command line and change your current directory to the directory where your executable jar file is, then typing "dir" followed by whatever is in the Class-Path entry should show you that referred-to jar.
However my preference would be to put the referred-to jars in the same directory as the executable jar. Makes things much simpler. If you were planning to keep things like Xerces in a standard directory and have all your executable jars refer to that, I think that's false economy. Besides which it isn't a practical strategy if you're going to distribute the executable jar along with all its dependencies. [ March 05, 2008: Message edited by: Paul Clapham ]