ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew B. Sudell" <>
Subject Re: Setting ANT_HOME in
Date Sat, 01 Jul 2000 19:38:15 GMT writes:
 > Andrew Sudell wrote:
 > >
 > > Since build.bat saves the old ANT_HOME, and can't
 > > bother it's parent environment, and the ant you just
 > > bootstraped may well be incompatible with the one in
 > > ANT_HOME, it's probably a good idea to always set ANT_HOME
 > > to the directory being build.
 > I often use Ant to build projects other than Ant itself...

Of course, that's the point.

But generally I build other projects using ANT_HOME/bin/ant
(in the case of local development) or the build script in
the project (when supplied as in the case of the jakarta projects).
Honestly, it had not occurred to me that anyone would use the build
scripts in jakarta-ant to build other things.

I'd prefer that build.[sh|bat] add the local ant.jar to the classpath,
but for my purposes, I can unset ANT_HOME before building ant.
(The paranoid part of me should have thought of that anyway!)

As I've had an opportunity to build on other machines though,
I've hit a related issue.  The other change was to explicitly
invoke java with "-classpath $LOCALCLASSPATH".  On JDK 1.1.x,
unfortunately there is a difference between 

java blah


java -classpath foo:bar blah

Since the java script alters CLASSPATH before loading the VM. Using
"-classpath" ends up omitting from the classpath, and
results in the error

Unable to initialize threads: cannot find class java/lang/Thread

Can I suggest adding something like

if test -f $JAVA_HOME/lib/ ; then

to to get around that difference?  The alternative
might be to set and reset classpath in the environment and
avoid the -classpath flag.

        Drew Sudell

View raw message