Re: Nine ways of identifying Class-Path in manifest that don't work
On 2009-12-23 14:16:27 -0500, Composer <composer@uwclub.net> said:
I've read several posts about Class-Path and they generally seem to
assume that I know how to specify the location of a directory relative
to the directory of the jar being executed. I'm running OS X.
The jar to be executed is
/Java projects/myname/utilities/DesktopApp.jar
The external jar containing classes I need is
/Java projects/javamail/mail.jar
So the external jar file is two directories up and then one directory
down from my main jar.
The compiler is perfectly happy finding the classes in mail.jar.
If I explicitly load all the classes from mail.jar into
DesktopApp.jar, it executes fine.
Here are the variants I have tried in my manifest:
Class-Path: .;.../javamail/mail.jar
Class-Path: .;../javamail/mail.jar
Class-Path: .;./javamail/mail.jar
Class-Path: .:.../javamail/mail.jar
Class-Path: .:../javamail/mail.jar
Class-Path: .:./javamail/mail.jar
Class-Path: .../javamail/mail.jar
Class-Path: ../javamail/mail.jar
Class-Path: ./javamail/mail.jar
All nine of these attempts result in NoClassDefFoundError when I
execute DesktopApp.jar.
Others have already identified the problems with using relative paths
in a manifest's Class-Path: entry. However, it's also worth being aware
that the path separator in the manifest is a space, NOT colon (:) or
semicolon (;).
-o