[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Setting Class-Path in manifest file



Chuck Williams wrote:

I was hoping that someone would know the answer to this question.

I’ve got my Class-Path attribute in the manifest.mf file properly set but I’m still getting ClassNotFound exceptions. I’ve got all the jar files that the Class-Path references stored inside my jar file in the root. This doesn’t appear to be working. Is there anyway to accomplish this without unpacking all the jar files and then including them directly as .class files in my jar file?

I don't think you should store your library jars in your jar, not as jars anyway. if you want to use jars, put them in a directory under the location of the jar:
/main.jar
/lib/lib_jar1.jar
/lib/lib_jar2.jar

and than use the class-path attribute to reference them.

if you insist on having your application distreburted as a single jar, you will to put the classes from these jars into your main jar, not the jars themselves.
I think there is an ant task call jarlink that does something like that.



Reply to: