# Help getting Ant installed and to run

Davy Kelly
Ranch Hand
Posts: 384
Hi everyone,

I am going through the Agile Java book by Jeff Langr, and the book says to install Ant.

I have downloaded a zip file for my windows machine, and extracted the zip file to a directory called ant in C:
C:\ant
C:\ant\apache-ant-1.6.5

I have appended my classpath to include C:\ant\apache-ant-1.6.5\lib\ant.jar;

then I appended my path with C:\ant\apache-ant-1.6.5\bin;

I then made a new variable and called it ANT_HOME and set the environment as C:\ant

But when I try to use ant, by typing at the command line:
C:\ant I get a:

how can I make the Ant see the tool.jar in the C:\Program Files\Java\jdk1.5.0_03\lib not the C:\Program Files\Java\jre1.5.0_04\lib\tools.jar

Davy
[ August 12, 2005: Message edited by: Davy Kelly ]

Tim Holloway
Bartender
Posts: 18408
58
Actually, ANT_HOME should be defined as the root directory of the unzipped Ant. That is, "C:\ant\apache-ant-1.6.5".

I don't know offhand if Ant uses the JAVA_HOME environment variable or not. A lot of Java apps do, but not all of them.

Davy Kelly
Ranch Hand
Posts: 384
sorry, I forgot to add in the apache-ant-1.6.5 as the ANT_HOME, in my above post.

I double checked and I do have this variable set to what you suggested, but it still not working.

davy
[ August 12, 2005: Message edited by: Davy Kelly ]

Davy Kelly
Ranch Hand
Posts: 384
I eventually done it, My JAVA_HOME was not pointing to anything.

Davy