Paul said:
John C. Bollinger wrote:
On the contrary. Packages typically live in a directory hierarchy. In this
case, it is literally true, and it is the source of the OP's "problem".
You have snipped out the reasons I gave for my assertion without
responding to them, and then contradicted me without offering any
argument of your own. I admit that's a strategy that tends to quell
debate, but I can't say I find it very persuasive. In the new spirit of
this discussion, then, I will simply reassert that no, packages do not
live on a filesystem. Class files may, and typically do, reside on a
filesystem. More often than than not they even reside on a local
filesystem with respect to JVMs that load classes from them. But a
package is simply a collection of classes (NOT class _files_), with no
physical representation of its own at all. It certainly does not have a
"root directory".
Whether this is nonsensical in a design sense is another matter entirely. It
is certainly the source of the immediate complaint.
Getting back to the OP's question, then, which pertained to the
"user.dir" system property: my main point was that you have
misidentified the nature of that property. That your explanation had
any semblance of correctness at all was an artifact of the environment
in which the OP started his program. If the OP attempted to develop a
solution based on your claims he would at best find that it didn't work,
and at worst find that it _appeared_ to work, only to realize later that
whether or not it works depends on how the program is run.
John Bollinger
(e-mail address removed)