"Andrew Thompson" wrote:
>> Also, it is exceedingly fragile to specify complete paths
>> to jars in the classpath. It would be better to place the
>> extension jars in a place where they can be referred to be
>> relative paths.
> I am just reviewing the different ways of doing things. It's a self-
> imposed homework, to test the tricky things like paths with spaces.
[quoted text clipped - 9 lines]
>
> The class path above expects all the jars to be inside the directory 'lib',
relative to where the JAR is installed
> but in real life, the original files are inside a subdirectory called program/classes.
Relative to where the JAR is deployed? If so, you could put that in the manifest.
> This detail is easy to solve, right? Just make
> a shortcut called "Program_Files", another one called
> "OpenOffice.org_2.3" and one called "lib" that points to "classes".
I don't know what this all means.
> All Windows developers out there (except me, until now) know that you
> cannot see those "directories" from the Command Prompt.
Seeing directories from the command prompt isn't really the point. The point
is that the JAR containing your application is in a directory. ("Program
Files" is probably not the best choice, since a JAR isn't actually a program.)
Anyway, the manifest directories are relative to the directory in which the
JAR is deployed.
The problem with absolute paths is that they might not exist on every platform
to which the JAR is deployed. What if you say "C:\blahdiddyblah\blah" then
deploy to a UNIX machine?
I also strongly suggest you stay away from ../whatever (relative parent
directory) paths - again, it's hard to guarantee that they'll exist everywhere
you deploy your JAR. Subdirectories are easier to ensure.
Forward slashes are the way to go in a manifest, or really any time. Windows
recognizes forward slashes. It looks like they're actually required, judging
from
<http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest>
which states
> # Class-Path :
>
> The value of this attribute specifies the relative URLs
> of the extensions or libraries that this application or extension needs.
> URLs are separated by one or more spaces.
URLs need forward slashes. Note also the specifciation of _relative_ URLs.
NetBeans also usually creates a dist/ directory, doesn't it? Wherever it
places the JAR you build, it's /supposed/ to create a subdirectory for
requisite JARs, by default lib/ relative to the JAR location. I have heard
there might be a bug with respect to this with application JARs, although it
works just fine for the WEB-INF/lib/ subdirectory of web applications.

Signature
Lew