Aha! I logged a bug against this with Sun, and they accepted it IIRC only to tell me I was (basically) being annoying (and I kind of see their point) - IIRC (I'll need to check what happened, actually).

My bug/RFE basically goes:

"sourcepath is one of the worst named flags ever: it doesn't mean what it says, it actually means something different.

Worse, the documentation that comes with java 1.4.x provides a description that is incorrect - it describes something different to what is implemented because it omits a crucial sub-clause.

Please either change the docs, or even better rename the flag and also add a flag that really does mean "-sourcepath" because I actually need one!"

(My reasons for "needing" this flag are unusual, and to do with running javac in an environment where it is a *very* bad thing to list the contents of the current working directory, which - unfortunately - javac is hard-coded to do in it's search for sources; I wanted it to use sourcepath to force it to look in a sub-dir ONLY, and not list the CWD, which incurs a massive performance penalty)

If you want to know more, I suggest you get a JDC ID (sorry - I hate the fact you need to do this, but it is free), go to Sun's Bug Parade (google for it), do a search for bugs to do with sourcepath, and read the bug and the comments.

It actually means (this is/was not documented by Sun) "the path where source files are loaded from ONLY when they are needed for recompilation of external classes referenced by the main source (which, because sourcepath doesn't do what you think it does, can ONLY be compiled from the current working directory) which javac cannot find class files for, and so has decided to automatically compile from source in order to work out if the source code you are asking it to compile actually compiles". Phew.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org