I want to package my external jars (that are in lib/) and the jar that I am building of the class files all into one jar. Ive tried to do it as:
jar cvf proj.jar -C classes/ . lib/
The jar gets built up but when I use this jar in the program, the external jars supposed to be included as lib/ end up missing. So I think this is perhaps not the right way to do this.
I have tried exporting a jar through eclipse too (though I would like to fix the command line stuff) by giving it the location of external jars and I still had the problem of the program unable to locate the external jars.
You cannot (by default) nest jars in this fashion.
You may, however, use something like JarClassLoader to do this, or something like onejar (or jarjar, or fatjar, etc.) that repackages jar contents into a single, un-nested jar.