Installing ANT on Windows and or Mac OS X
I'm gonna try and cover the two OS's here so be kind.
First things first, goto http://ant.apache.org/bindownload.cgi and download the appropriate archive (zip) file: apache-ant-[VERSION NUMBER HERE]-bin.zip
Then for Windows: Extract the .zip to c:\ant. From the command line set the following environment variables:
2set JAVA_HOME=c:\jdk-1.5.0.05
3set PATH=%PATH%;%ANT_HOME%\bin
2export PATH=${PATH}:${ANT_HOME}/bin
Now open up the Terminal(Mac)/Command line(Win) and just type "ANT" and hit return. You should see:
2Build failed
To demonstrate calling a file we're gonna create a quick build.xml. Create a new text file, enter the following bit of XML and save it as build.xml
2<project name="myProject" default="runEcho" basedir=".">
3 <target name="runEcho">
4 <!-- Simply echo's a message to the screen -->
5 <echo message="Is anybody out there"/>
6 </target>
7</project>
If you are on Windows save this file to the root of c:\ and from the command line run the following
If you are on Mac then just save this to the desktop and from the Terminal run:
2
3runEcho:
4[echo] Is anybody out there
5
6BUILD SUCCESSFUL
7Total time: 0 seconds
That's pretty much it, from here you you are now set to run Ant from the Terminal/Command line so in theory you should be able to schedule tasks etc!
| Tweet |
| If you like what you see on the website and/or this post has helped you out in some way please consider donating to help keep me in beer vodka. The donations are made through Paypal, which accepts almost any credit card or eCheck. |
http://www.microsoft.com/msagent/default.asp
http://www.andyjarrett.co.uk/andy/blog/index.cfm/2...
danke
I hope it's useful, and let me know if you'd like to develop it further.
Really Helped me.. someone new to ANT.
Cheers !!!
Sriram
I have installed ant 1.8.1 on my Windows XP and set the path varieable to the bin folder of ant.
But, when i typed 'ant' in command line i am getting this error messaeg-
'ant' is not recognized as an internal or external command,
operable program or batch file.
Can you please help me in this ?