Re: RFH: compiling java with kaffe/jikes/ant
Laszlo 'GCS' Boszormenyi wrote:
thank you for your kind bug report.
When I set JAVA_HOME to the SUN's J2SDK 1.4, then ant succeds (it is not
in the PATH/CLASSPATH otherwise). However when I set JAVA_HOME to /usr,
so it uses kaffe/jikes, it fails with this message:
Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK
That's essentially a problem in ant's upstream: It tries to use the JDK
by default and fails if it can not find some undocumented classes from
Sun. It would be nice if ant was able to detect that it's not running on
a JDK and use another compiler, as the underlying mechanisms are all
there (i.e. it supports other compilers (jikes, kjc, external javac
command) & runtimes beside non-free ones). Please file a wishlist bug
report with ant developers for that.
In the meantime, you have to explicitely tell ant not to use javac, but
to use jikes instead by setting the ant property 'build.compiler'. You
can set in on command line or in ant's properties file. The ant
documentation should have more information on that.
Additionaly during configure I get:
Unable to locate tools.jar. Expected to find it in /usr/lib/kaffe/pthreads/lib/tools.jar
May it be a packaging problem? Kaffe in Woody contains tools.jar, but
not the one is in Sarge/Sid; and I was unable to find any note why it is
missing by now.
Kaffe's tools.jar was never a real equivalent for Sun's tools.jar, it
just contained some of the tools shipped with kaffe.
Sun's tools.jar is completely undocumented. It is rumoured to contain
their javac compiler, and may contain other classes that are not part of
the specified Java APIs.  Sun actually condemns the use of those
undocumented APIs, but it doesn't seem to prevent people from abusing
 Unfortunately, it seems to be an ocassional practice among a
fraction of java developers to write unportable Java code by going
beyond the Java APIs, and using undocumented classes in the sun.*
packages. Run anywhere, yeah, right ;)