FAQ Update
Tom Tromey
tromey@cygnus.com
Fri Nov 5 08:37:00 GMT 1999
>>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:
Jeff> I don't know exactly how gcj resolves classes (I haven't
Jeff> examined the code closely) but it seems to favor .class files in
Jeff> the CLASSPATH, if any... otherwise it will use the source
Jeff> (.java), also in the CLASSPATH. If it can't find either it
Jeff> throws an error.
That's right, but it also checks to see if the class is newer than the
.java file. See find_class() in jcf-io.c. There is some
path-scanning code in parse.c (read_import_dir()), too, but I don't
know what it is used for.
Here is a comment from jcf-path.c explaining how classpath options are
used:
/* We support several different ways to set the class path.
built-in system directory (only libgcj.zip)
CLASSPATH environment variable
-CLASSPATH overrides CLASSPATH
-classpath option - overrides CLASSPATH, -CLASSPATH, and built-in
-I prepends path to list
We implement this by keeping several path lists, and then simply
ignoring the ones which are not relevant. */
HTH,
Tom
More information about the Java
mailing list