1). If you are using Windows OS then right click the MYComputer icon.
2). Go To its Properties and there set the environment vars.
3).In the System vars add a new var called ANT_HOME=c:\ant (assuming that your ant folder name is ant).
4).It is advisable to change the name of your dir to a smaller length like c:\ant ,rather than c:\jakarta-ant-1.3.
5).Also after setting the ANT_HOME var,next set the path of you system to contain its bin dir. i.e
set path=%path%;%ANT_HOME%\bin;c:\(your jdk (c:\jdk\bin) path).
6).Lastly set JAVA_HOME=c:\jdk (wherever your jdk folder exists)
Thats about it.After carefully setting all the vars
test to check if everything is fine,by running ant on the command prompt.
If it gives you a Build failed message you ant is working fine.
Else again check your path and try again.