ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian FitzGerald <>
Subject Re: Ant not respecting JAVA_HOME
Date Mon, 22 Aug 2011 12:35:26 GMT
Thank you for the response, Santanu.

> Do you have the build.xml in the directory from where you are running ant?
> How you are calling ant?

I didn't before, but since you mentioned it I grabbed a simple hello world
build file and put that in a directory called C:\AntTest  -- I am calling
Ant from the Window command line by navigating to the AntTest directory and
then typing the "Ant" command.

> You can create a script and set the java_home just before calling
> %ANT_HOME%/bin/ant.

Do you mean I can set the JAVA_HOME variable within the build.xml?  Or with
a command each time I run the script?  I have tried setting JAVA_HOME
immediately before running the Ant command in the Windows command line but
got the same result.

>The ANT_HOME should be C:\Program Files\Apache Software
>and not C:\Program Files\Apache Software Foundation\apache-ant-1.8.2\bin
>Try putting jdk.1.6.0_23 and apache-ant-1.8.2 in a folder which does
not contain spaces.

Sorry, I mistyped the ANT_HOME path in the original post, I actually had the
path set correctly.  Regardless, I have gone ahead and moved Ant to a
directory with no spaces as you suggested: C:\Ant and changed the ANT_HOME
environment variable accordingly.  I did not move the jdk because I'm a
little concerned that other apps are using it and I'm gonna mess something
up (kinda new at this).

So anyway, now when I run the build (with the build.xml in place), I get:

C:\Users\Brian>cd C:\AntTest
Unable to locate tools.jar. Expected to find it in C:\Program
Buildfile: C:\AntTest\build.xml

     [echo] Hello, World

Total time: 0 seconds

Buttom line: Ant is still looking in the wrong directory for Java (jre
instead of jdk).  Any idea what I could be doing wrong?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message