Andi Vajda <va...@apache.org> wrote:

> Emit an error message that says "sorry, gcj is not supported, please
> use OpenJDK or Sun JDK" and abort.

Right.  That's the problem, as I see it.  If you have Sun Java
installed, it's not necessarily first on your path.  But you want to
find it, even if it's masked by gcj.  You don't want to abort.

> JAVA_HOME is returned by System.getProperty('java.home'). Java should
> know best. If you can build and run that class, it means you have a
> JDK and you can now ask it to tell you about itself.

Right.  Now, suppose it tells you it's not the right Java, not a Java
that will allow you to use it.  What next?  I don't see a good
alternative to having some script that has a number of likely search
paths in it, and which searches each possible location until it finds a
suitable Java.  In which case, using Java to find "java.home" isn't much
use -- you're already looking in some specific spot.  Might as well use
the locate db to find all instances of javac, and search each directory
you find there.

Bill

Reply via email to