How to Install ANT in Windows XP

source: Instalasi ANT di Windows XP (Indonesia Version)

1.First,You must have JDK installed first.
2.Get the ANT for windows here:

http://ant.apache.org/bindownload.cgi

choose latest version with zip package
3.After download ANT,extract zip package in (for example) C:\Ant


4.Set ANT_HOME

  • Right click My Computer icon
  • Choose properties
  • Choose Advanced Tab
  • Choose Environtmen Variables Button
  • In the System Variables, click New Button
  • Give the Variable Name:ANT_HOME
    Give the Value: C:\Ant
  • Click OK
  • Then,we’ll add new ANT_HOME path,

Find PATH in the Variable Column in System variables frame

  • After found, click Edit button
  • Then, add the following text in the bottom of Variable value:
    %ANT_HOME%\bin; 
  • Click OK to finish

5.Check wheter ANT works correctly or not.
In the command prompt, type:

ant -version

then click enter,
if the result text is something like:

Apache Ant version 1.7.1 compiled on June 27 2008

then your ANT is work correctly on your Windows

6.The end.

Advertisements

72 Comments

Filed under Java

72 responses to “How to Install ANT in Windows XP

  1. Pingback: How to Install GlassFish Application Server on Windows XP « Think and Write It

  2. rudi

    Thank You for The tutorial….

    I already success installing ant at my windows XP

  3. @rudi
    You’re welcome..
    ๐Ÿ™‚

  4. are5thfee

    i ve got

    ‘ant’ is not recognized as an internal or external command,operable program or batch file.

    pls help

  5. @are5thfee
    the problem could be about setting path.
    Give the ANT_HOME=C:\Ant and %ANT_HOME%\bin; path on your Environment, then it should work now.
    ๐Ÿ™‚

  6. Ashish Vaish

    thanks……:)

  7. try WinAnt (http://code.google.com/p/winant/) it’s an installer i made for Ant on Windows

  8. @mason
    yeah…thanks for information.that would be easier using ant for windows user.

  9. avis

    thank you it was very helpful but does this have a effect on antivirus.it is saying that antivirus is not installed when it was installed before making changes to the environment variables

  10. jibran

    very good !God bless

  11. Speedy

    Hey
    Thanks for the how to but does it work on windows 2003 server ?

    I think I did everything as you said but it doesn’t work ๐Ÿ˜ฆ

  12. PRATHIBHA

    Hi,

    Your tutorials helped me a lot to instal ANT on my system.

    Thanks,
    Prathibha

  13. Ruwan

    Many thanks.

  14. thanks om rud. ๐Ÿ˜›

  15. dhiraj

    i have follwed the said procedure but it is showing this error ……..

    C:\Documents and Settings\Dhiraj>ant -version
    ‘ant’ is not recognized as an internal or external command,
    operable program or batch file.

    please help

  16. dhiraj

    i am again getting the error
    C:\Ant>ant -version
    ‘ant’ is not recognized as an internal or external command,
    operable program or batch file.

    plz help

  17. dhiraj

    i have again got this
    C:\Documents and Settings\Dhiraj>ant -version
    ‘ant’ is not recognized as an internal or external command,
    operable program or batch file.

    plzzzz helpp

  18. bon

    For those that are getting errors like
    “C:\Ant>ant -version
    โ€˜antโ€™ is not recognized as an internal or external command,
    operable program or batch file.”

    Try adding the ANT_HOME and PATH variables manually on windows environment variables.
    After that, restart windows.

    Thanks for the how to ^_^

  19. For other XP users that are having the same problem as “bon” and “dhiraj’ make sure that you put %ANT_HOME%\bin at the BEGINNING of your PATH variable. This tripped me up for a while and I thought I would pass it along.

  20. sandy

    Thanks
    great tutorial for developer.

  21. compiler

    Thank you very much !

  22. Thanks so much for this tutorial. I don’t much much about using Java or C on Windows and never had to configure my University server myself so setting all this up was baffling.

    Apache are terrible at explaining anything, I want to learn Velocity but it’s kinda hard when I can’t even install the Builder.

    Cheers!

  23. compiler 2

    Thanks dude.. the most easily documented site for Ant installation ๐Ÿ™‚

  24. aziz

    hiiii all
    when I try to install ant I am getting the following message. Please help me to install ant
    Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
    b\tools.jar
    Buildfile: build.xml does not exist!
    Build failed

  25. Liz

    @aziz:

    I’ve had the same problem; from the net, I picked up an answer: to check my JAVA_HOME variable.

    In my case it was set correct, so I just looked for tools.jar and copied it where the install was looking for it. It worked!!

  26. Girdhar Singh Bora

    I am able to install ant.

  27. The Petarung

    @Gidhar
    Okey…we hope u enjoy ๐Ÿ™‚

  28. Roho

    I am having trouble installing ant as well at first i was get the โ€˜antโ€™ is not recognized as an internal or external command,
    operable program or batch file.โ€ error and then i changed the variable and path and now i get

    โ€˜Java.exeโ€™ is not recognized as an internal or external command,
    operable program or batch file.โ€

    what should i do?

  29. onlineWill

    go to environment variable:
    New > variable name: ANT_HOME
    variable value: c:\Ant (path to your ant folder…)

    hit OK.

    Again,
    New > variable name: JAVA_HOME
    variable value: c:\Java (path to your java folder…)
    hit OK.

    edit path: variable name: path
    variable value: %ANT_HOME%\bin;%JAVA_HOME%\bin

    thats it.
    Good luck.

  30. nassir

    how can use ant with eclipse and sphinx?

    thank you

  31. Sridhar

    Thaks a lot for your tutorial

  32. Fenky

    thanks a lot for the tutorial

    it helps a lot
    Anyway, can I ask
    How to run a build.xml file?

    I get build.xml doesnot exist even I have made one in my ant directory

    tq

  33. qamar

    i read all the comments and they helped me to run ant for Mnm
    thanx every 1

  34. shoosh

    I’ve successfully gotten ant into my system because it says Apache ant version when i type ant -version, but it still says no build.xml does not exist. what do i do???

  35. C:\ANT\bin>ant -version
    ‘”java.exe”‘ is not recognized as an internal or external command,
    operable program or batch file.

    Plz Help

    freinds

  36. Max Mohave

    Wow, I have added stuff before, but your example was clean and showed the relationship between ANT_HOME and the System Path.

    Nice job

  37. Good article…short and sweet…Great help…Thanks ๐Ÿ™‚

  38. Shiv

    Thanks for the guidance. It works!! But we need to reboot the system to get it working.

  39. meena

    ant is not an external or internal command,operable or batch file it is coming pls help

  40. thxx,
    here is installing ANT for Windows 7 & Set environmental variables via command prompt
    http://madhukaudantha.blogspot.com/2010/06/installing-ant-for-windows-7.html

  41. annaling

    Thank you for the useful tutorial. : )

  42. Devadas

    Thanks for this link. This really helps… ๐Ÿ™‚

  43. it works,thanks for the tips.

  44. Thanks this worked, also remember to restart

  45. SS

    who has java.exe error do this:

    New > variable name: JAVA_HOME
    variable value: c:\Java (path to your java folderโ€ฆ)
    hit OK.

    edit the path, add this at the begining:
    C:\Program Files\Java\jdk1.6.0_03\bin;%ANT_HOME%\bin;

    that works for me , the solution from here and a link provided.

    thanks

  46. nisha

    thanks dude,it works..

  47. Srichakra

    @aziz copy your tools.jar file from jdk folder to jre this will solve the issue

  48. dylanp

    It is important to close and reopen the CMD window so it will pick up new environment variables

  49. While installing i m getting following error plz plz help guies. i have set environment variable for both java & ant as well.

    Error occurred during initialization of VM
    C:\Program Files\Java\jdk1.6.0_03\bin;%ANT_HOME%\bin;

  50. Dear sir,
    i have set environment variables correctly but it return ant is not an recognized internal or external command. After set environment variables either restart windows or no need to restart?

  51. goodluck

    Hi,

    I am getting ‘ant’ not recognized error in cmd prompt, even after I restarted my system.

    Please help, I followed all the steps mentioned above, but no luck.

    thanks in advance

  52. kannan

    Hi,
    as per your explain step by step installation for ant my system have set the environment variable and system variable are set and after i have restart the system. then also have a same problem ‘ant’ is not recognized as an internal or external command operable program or batch file.

    please help out this issue

  53. syed

    Hey Hi

    I have followed the same steps but it still throws out errors
    โ€˜antโ€™ is not recognized as an internal or external command,
    operable program or batch file.

    Please help

  54. Jordi

    Thanks. It works.

  55. Suresh

    check these steps
    1) unzip ant in a path for eg; C:/ant;
    2) copy the path don’t type just copy it and paste it in env variable path for eg:- ;C:\ant\bin;
    3) Don’t forget to set java_home too
    4) Now check

  56. This is very helpful…thanks a lot….

  57. Vitor

    Funcinou supimpa, brigadao!

  58. Pingback: Working with SunSPOT | Littleting

  59. Jeff

    Should I install Ant from Eclipse updates or do it manually?

  60. suri

    Thank you very much its working ,,,,,…..

  61. You can certainly see your skills in the work you write. The sector hopes for even more passionate writers like you who are not afraid to mention how they believe. At all times follow your heart.

  62. hrishi

    I hv installed ant correctly and also the path is set appropriately. On entering ant -version also it shows me the version but when I am running a batch file that has ant commands then i get a error that command cannot be recognized.

  63. Pingback: Installare Apache Ant su Windows XP / Vista โ€” Davide Salerno

  64. Thanks. It works for me. You have sorted fine the guide! See you later.

  65. very thanks for this tutorial….its really helpful..

  66. Aditya

    good tutorial… ๐Ÿ™‚

  67. Pingback: Toronto Computer Repair

  68. I personally have a tendency to go along with the whole thing that is
    put into writing in โ€œHow to Install ANT in Windows XP | Think
    and Write Itโ€. Thank you for all of the actual details.
    Many thanks-Mabel

  69. antony paul raj

    AMAZING..

  70. dude

    Jonathon’s fix worked for me. To reiterate for those having the โ€˜antโ€™ is not recognized as an internal or external command,operable program or batch file error:

    Move %ANT_HOME%\bin; to the START of your environmental Path variable. It won’t work at the end for some reason!

  71. DJ

    I have got Error :-
    โ€˜antโ€™ is not recognized as an internal or external command,operable program or batch file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s