Which javac is being used?

Herve Quiroz herve.quiroz at esil.univ-mrs.fr
Thu Jan 27 12:02:09 PST 2005


On Fri, Jan 28, 2005 at 07:28:54AM +1300, Jonathan Chen wrote:
> On Thu, Jan 27, 2005 at 02:05:46PM +0800, Jiawei Ye wrote:
> > On my server, both JDK14 and JDK15 are installed. I can select proper
> > javavm by setting $JAVA_HOME, but only the 1.4 javac is used when I
> > invoke 'javac'.
> 
> The /usr/local/bin/java shell script inspects /usr/ports/bsd.java.mk
> for the default JVM to use. You have to set the JAVA_VERSION
> environment variable to force it to pick the one you want to use.

That's true.

But what intrigues me is the fact that both 'java' and 'javac' should
use the same logic to pick a JDK (afterall they are both symlinks of
the same 'javavm' file). Hence whichever JDK is chosen, 'javac -version'
and 'java -version' would output the same version number...

I'll try to see if I can reproduce the same error as you Jiawey, once
the java/jdk15 build is done on my box (if I don't lack free HD space
until then).

But in the mean time, here are my quick two cents:

Is it possible that you use an alias javac->jikes with some
JIKES_BOOTCLASSPATH (or equivalent) set to /usr/local/jdk1.4.2/...

Jiawei, could you try running the same commands but undefining JAVA_*
beforehand (and just with JAVA_VERSION=1.5 as suggested by Jonathan)?

Herve


More information about the freebsd-java mailing list