How to install Apache Ant on Windows 7

13,887

I think the path is not set properly.

set JAVA_HOME=C:\Program Files\Java\jdk1.7.0
set ANT_HOME=D:\software\apache-ant-1.9.4
set PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin

Edit: fixed PATH definition

Share:
13,887
apss1943
Author by

apss1943

Updated on June 04, 2022

Comments

  • apss1943
    apss1943 almost 2 years

    I want to install Apache ant on windows. Here is some information below:

    I followed its descriptions and step by step but it still cannot work. I think the entire environment variables I set are correct. May please someone helps me? And some copies from cmd.

    C:\>echo %ANT_HOME%
    C:\Program Files\apache-ant-1.9.4
    
    C:\>echo %JAVA_HOME%
    C:\Program Files\Java\jdk1.6.0_34
    
    C:\>java -version
    java version "1.6.0_34"
    Java(TM) SE Runtime Environment (build 1.6.0_34-b04)
    Java HotSpot(TM) Client VM (build 20.9-b04, mixed mode, sharing)
    
    C:\>ant 
    is not recognized as an internal or external command,operable program or batch file.
    

    My Ant version is 1.9.4