• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 506
  • Last Modified:

How do you install Apache Ant? trouble setting ANT_HOME

I downloaded apache ant from the website. I unzipped the file to my desktop and attempted to add and set the environment variable ANT_HOME. I created a variable name: ANT_HOME and set the variable value: C:\Users\Administrator\Desktop\apache\apache-ant-1.8.2\bin then I run ant -version in the cmd window but it says 'ant' is not recognized as an internal or external command,
operable program or batch file. Am I pointing it to the wrong file or how should the ANT_HOME value be set? Is there anything I need to do besides that when trying to install and setup apache? There's no .exe file to open and run.
0
anshealth
Asked:
anshealth
  • 5
  • 2
1 Solution
 
yjchong514Commented:
Edit your PATH environment variable to include Ant's "bin" directory. The exact steps for editing your path with depend on your operating system, but for example on XP:

Bring up Explorer (Windows-E)
Right-click on "My Computer" and select "Properties"
On the "Advanced" tab, click on "Environment Variables"
If the set of "user variables" already contains a PATH entry, edit that. Otherwise create a new entry. (If you want it to affect all users, set it as a system environment variable.)
Add the Ant bin directory without any quotes. Use a semi-colon to separate it from another entry. For example, you might have:

c:\Program Files\Utils;c:\Program Files\Ant 1.7\bin Start a new Command Prompt to see the changes (they won't affect existing windows)

NOTE:
1. Always remember, don't put a SPACE after each semicolon.
--------------------------------------------------------------------------------
Good:
C:\Turtle;C:\ant

Bad:
C:\Turtle; C:\ant

0
 
anshealthAuthor Commented:
That worked but now I get the following error when I type ant -version in DOS:

Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
b\tools.jar

so I did echo on JAVA_HOME, ANT_HOME, and PATH it returned:

C:\Users\Administrator>echo %JAVA_HOME%
C:\jdk-1_5_0_17-windows-i586-p

C:\Users\Administrator>echo %ANT_HOME%
C:\Users\Administrator\Desktop\apache\apache-ant-1.8.2

C:\Users\Administrator>echo %PATH%
C:\Users\Administrator\Desktop\apache\apache-ant-1.8.2\bin ... plus other stuff...

I'm working on Windows Server 2008 Standard

0
 
yjchong514Commented:
Since you are working in windows, why not try this to MAKE LIFE EASY
http://code.google.com/p/winant/

IT automates ALL setup process in WINDOWS.

Time to collect points, I guess. :-)
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
yjchong514Commented:
If you still insist to prefer traditional way, go for:
http://javawithbrain.blogspot.com/2010/12/installing-apache-ant.html

GOOD LUCK!

0
 
anshealthAuthor Commented:
Thank you!
0
 
yjchong514Commented:
Problem:
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
b\tools.jar

Solution:
You need to installed the JDK (Java Development  Kit) and set JAVA_HOME.
I think you only have Java Runtime on that machine.
0
 
yjchong514Commented:
Ooh! You solved the problem, then it 's good to hear that.

Happy working and Happy weekend!

Bye.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now