[Kaffe] bug in javac! (it ignores the -classpath argument)

Moses DeJong dejong at cs.umn.edu
Tue Jan 5 22:36:59 PST 1999


On Thu, 31 Dec 1998, Godmar Back wrote:

> > 
> > The javac program in the kaffe bin directory seems to ignore the
> > -classpath argument. If the -classpath argument is given then
> > the CLASSPATH env var should not be used during the compile.

I know that not how kaffe's javac program works. I am just saying that
it is how Sun's javac wrapper works. Giving the -classpath argument to
Sun's javac program makes it ignore the CLASSPATH all together.

> No, that's not how it works.
> The -classpath argument to javac is different from the -classpath
> argument given to java.
> 
> The -classpath argument to javac only determines where javac looks for 
> .class files which it needs to compile .java files.
> 
> It will still use CLASSPATH to determine the location from which to
> read its own code.  
> 
> As an aside, both options can be combined, as in
> 
>     java -classpath A sun.tools.javac.Main -classpath B
> 
> Here, A is the setting that overrides CLASSPATH; but B does not.

Why exactly is this "correct". It makes it very difficult to use the
kaffe javac because I would have to set the CLASSPATH and use
the -classpath argument to javac. I can not control what people
have the CLASSPATH variable set to. If they set the CLASSPATH so that
it includes Sun's classes.zip (and a lot of people will), then I would
have to prepend the Klasses.jar file to the CLASSPATH and use the
-classpath argument to javac. Why wouldn't the kaffe javac prepend
the Klasses.jar to the CLASSPATH on startup. It seems like that would
avoid this whole mess. Also, using the "java sun.tools.javac.Main" is a
really bad idea because it makes the script depend on both the java
executable and Sun's sun.tools.javac.Main class (this is a bad thing).


> Kaffe's behavior is correct, and fortunately we finally got around to
> having kaffe print this nice and informative error message :-)
> 
> 	- Godmar
> 
> 


I hope that helps
mo dejong
dejong at cs.umn.edu



More information about the kaffe mailing list