> From: Moses DeJong [mailto:[EMAIL PROTECTED]]
>
> I just got the cvs tree and tried to compile it. Here is what went
> wrong.
>
>
> java -classpath /usr/local/java/lib/classes.zip sun.tools.javac.Main
> -classpath ../lib:/usr/local/java/lib/classes.zip -d ../lib
> ../java/lang/Cloneable.java
> Unable to initialize threads: cannot find class java/lang/Thread
>
> This is just so wrong. The configure script should NEVER use java
> on the sun.tools.javac.Main class. Why dont you just use this?
>
> javac -d ../lib ../java/lang/Cloneable.java
>
>
> It would work and you would not get into the horrible problems
> of finding the correct classes.zip to include in the -classpath
> argument (this is really ugly because different ports do it
> different ways). If you just use "javac" then you will not run
> into these issues. In addition other jvms will not call the
> compiler sun.tools.javac.Main. Could someone please fix this?
>

There's at least one good reason why we do this: we need javac's classpath
and the ordinary classpath to differ.  Javac needs to be drawing classes
from already-compiled classes in Classpath, but if we're running a JDK-based
implementation, we must avoid having our classes actually loaded to be used
by the compiler, since many of them are incompatible because of
package-private and native methods.  Thus the main classpath, as you see
above, includes only Sun's classes.zip, and javac's classpath includes
../lib and *then* classes.zip.

This use of sun.tools.javac.Main is applicable only to javac.  Configure
will presumably be given the option to use other compilers like kiev and
guavac at some point, and those will hopefully not require such odd
contortions.

The thing that needs to be fixed in this instance is the location of
classes.zip.  Either configure needs to automatically find it, or there
needs to be a configure option to specify its location, like
Japhar's --with-sun-jdk=...

This should be fixed pretty soon.  In the meantime, you can move along
yourself by manually changing the Makefile or Makefile.am: change
/usr/local/java/lib/classes.zip to be whatever your classes.zip is.

--John Keiser

Reply via email to