This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant installation

 
Shweta Pershad
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have downloaded Ant 1.6.2 and extracted all its files. I am supposed to add an environment variable called ANT_HOME and add a few things to the classpath. How do I add the variables? I mean where and how? What commands do I use if I am running Windows XP? I have never used Ant and am new to changing things on the system.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See How to set the classpath FAQ.

Read or look down where it describes how to set on Windows, you can set ANT_HOME the same way.
 
Shweta Pershad
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

One important question....when downloading Ant which link should I follow? I got the binary type, and I am guessing that was not right 'cause nothing was recognised by my computer after setting the PATH and CLASSPATH. I am running Windows XP.

Secondly, is it necessary to first install Xerces-J for Ant to work?
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you set ANT_HOME? What java version are you using?

I assumed you were following the installation instructions from Ant manual:

Windows and OS/2
Assume Ant is installed in c:\ant\. The following sets up the environment:

set ANT_HOME=c:\ant
set JAVA_HOME=c:\jdk1.2.2
set PATH=%PATH%;%ANT_HOME%\bin


What do you mean by "nothing was recognised by my computer"?

After setting ANT_HOME, JAVA_HOME, and adding ANT_HOME's bin directory to the path (I usually add JAVA_HOME's bin as well) check what you get when you run these:

java -version
ant -version
ant -help
set ANT_HOME
set JAVA_HOME
set PATH
which java.exe
which javac.exe
 
Shweta Pershad
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I am following the Apache mannual. And I am running JSDK1.4.2_07. When I ran the ant -version command following is what I got...


Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\j2re1.4.2_07\lib\tools.jar
Apache Ant version 1.6.2 compiled on July 16 2004


I had downloaded ant-current-bin.zip and apache-ant-1.6.2-src.zip (this was from source/ folder). Am I facing this problem because I did not download the right zip file? Or did I get too much?

I have declared ANT_HOME and JAVA_HOME environment variables and added them to PATH.

The 'which' command was also not recognised on my system, maybe because I am running WindowsXP.

So, what must I do now?

Originally posted by Carol Enderlin:
Did you set ANT_HOME? What java version are you using?

I assumed you were following the installation instructions from Ant manual:


What do you mean by "nothing was recognised by my computer"?

After setting ANT_HOME, JAVA_HOME, and adding ANT_HOME's bin directory to the path (I usually add JAVA_HOME's bin as well) check what you get when you run these:

java -version
ant -version
ant -help
set ANT_HOME
set JAVA_HOME
set PATH
which java.exe
which javac.exe
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you get running javac -version?

Your post indicates that ant is looking for tools.jar as :
C:\Program Files\Java\j2re1.4.2_07\lib\tools.jar

That sounds like a JRE (runtime environnment) and not a JDK.

Check your java installation and/or pointers to java in path and classpath.
 
Shweta Pershad
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, that is where the problem was. My path variable was not pointing to the right installation. Fixed it now. Everything runs fine.....Thanks!
 
Scott Huddleston, Chicago IL
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had this problem when my JAVA_HOME environment variable contained a space at the end. It was screwing up my PATH. Once the path was set correctly everything worked fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic