Can this attribute be used to locate a jar within a jar? Specifically, I am working on a project where our class files are packaged in wcd.jar. We need to also distribute xerces.jar (or whatever the name is, that's not important here) with our application for XML DOM stuff. If we package xerces.jar inside of wcd.jar, can add something like
to the manifest file to locate it?
If not, how do we add xerces.jar to the classpath? We want this to be as painless as possible for our client.
Can this attribute be used to locate a jar within a jar?
No (I have seen countless people try). You could specify a JAR file as you have done and just make it available to the class loader (i.e. put xerces.jar in the VM execution directory "user.dir").
Alternatives include: - Packaging all classes into one big JAR (nasty) - Write your own class loader that does whatever e.g. look up the 'a' attribute in the 'f' file and expect jars to be in that directory and load classes from there
Thanks for your comments, Tony. I just want to clarify a little bit here. We want to be able to install our application on the customer's machine as seamlessly as possible. For our initial alpha release, we packaged everything in a single JAR and the customer only has to copy this jar to any where on his system. We really don't have the time to write any kind of installation software since this project must be finished within the semester and we already have our plate full with fulfilling the customer's requirements.
In short, we need a quick and dirty way to locate these third party JARs that we are using for our next alpha release when it is installed on the customer's system. If we have to give the customer three separate files, that might be satisfactory. So my next question how does the Class-Path attribute resolve relative paths? Is it resolved relative to the location of the JAR or relative to some other directory?
Thanks! I think one of the other team members has been fiddling with this as well. I sure hope we can figure it out. Our next alpha release is due next week. We don't have much time to test it to make sure it's worthy to release to the customer *sigh* It's going to be a long week.