How do you install Apache Ant? trouble setting ANT_HOME

Posted on 2011-05-06
Last Modified: 2012-08-13
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.
Question by:anshealth
    LVL 6

    Accepted Solution

    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)

    1. Always remember, don't put a SPACE after each semicolon.

    C:\Turtle; C:\ant


    Author Comment

    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

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

    C:\Users\Administrator>echo %JAVA_HOME%

    C:\Users\Administrator>echo %ANT_HOME%

    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

    LVL 6

    Expert Comment

    Since you are working in windows, why not try this to MAKE LIFE EASY

    IT automates ALL setup process in WINDOWS.

    Time to collect points, I guess. :-)
    LVL 6

    Expert Comment

    If you still insist to prefer traditional way, go for:



    Author Closing Comment

    Thank you!
    LVL 6

    Expert Comment

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

    You need to installed the JDK (Java Development  Kit) and set JAVA_HOME.
    I think you only have Java Runtime on that machine.
    LVL 6

    Expert Comment

    Ooh! You solved the problem, then it 's good to hear that.

    Happy working and Happy weekend!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now