Home / Java Patterns and Pitfalls     frequal.com

JAR Manifest Class-Path Dislikes Symlinks

It seems that making a symbolic link to a JAR file causes its Manifest Class-Path to break. If you have a directory X with file a.jar and b.jar, and a.jar includes b.jar in its Class-Path manifest entry, if a.jar is a symbolic link to the real JAR file elsewhere, then b.jar won't be found and you'll get "NoClassDefFound" exceptions.

The fix is to copy the jar file locally. So instead of making a.jar a symbolic link to a file in another directory, simply copy the file. This should be as easy as changing "ln -s" in your Makefile/build.xml to "cp".

Last modified on 26 Oct 2005 by AO

Copyright © 2020 Andrew Oliver