I have discovered an annoying inconsistency .

I am using ANT 1.2 with jdk1.3 ("modern" compiler).  In order to make sure I can
access all of the proper .jar files, I have put ant.jar, jaxp.jar and parser.jar
at the end of my $CLASSPATH in my shell.  I have also modified the ant.sh script
which comes with ant to pick up the $CLASSPATH from the shell and add
$JAVA_HOME/lib/tools.jar to the end.  Doing it this way, ant runs like a dream.

But, it's a bit messy to have ant.jar, jaxp.jar and parser.jar in my $CLASSPATH,
so I tried changing the wrapper script a bit to invoke the java engine with the
-Djava.ext.dirs property set to point to the directory which contains those
jars.  When I attempt to run ant this way (regardless of whether ant.jar,
jaxp.jar and parser.jar are explicitly in my $CLASSPATH), I get the following
output:

jeedev-ter->ant
Searching for build.xml ...
Buildfile: /jeedev/univ/java/src/build.xml

antdir:

main:
    [javac] Compiling 1 source file to /jeedev/univ/java/classes
    [javac] Modern compiler is not available - using classic compiler

BUILD FAILED

/jeedev/univ/java/src/com/lawson/rdtech/ant/build.xml:9: Cannot use classic
compiler, as it is not available

Reading back through postings about this issue, the only solution given seems to
be to make sure that $JAVA_HOME/lib/tools.jar is in my $CLASSPATH.  Well, that
jar file IS in my $CLASSPATH here, and ant is still confused about which
compiler I want to use and where it's located.
I've also tried putting $JAVA_HOME/bin at the very front of my $PATH, which also
didn't help.

Any suggestions?

Thanks,

--dave


Reply via email to