Install ANT
Setup ANT
Install ANT (Optional, but a good idea)
Download ANT
Go here to download ANT. Save it in one directory.
Install ANT
What you need to do is just unzip ANT zip file and put it under one directory. Here we put it under C:\.
The ANT home directory is C:\apache-ant-1.6.5. Set environment variables. You already know how to set up environment variables through JDK setup.
A new variable is ANT_HOME, value is <installation path>. Like here ANT_HOME=C:\apache-ant-1.6.5. In VALUE text filed of the variable PATH, append <ant bin path> at the end of line. Like this: %ANT_HOME%\bin.
//In variable CLASSPATH, its value should add %ANT_HOME%\lib
Because we will use Tomcat as our web server, so we need to copy Tomcat’s catalina-ant.jar file (under Tomcat Home\server\lib directory) to ANT lib directory.
How to use ANT, read ANT tutorial.
Test ANT
Before you use ANT, check your Tomcat’s port number. Is it 8080? Then check your Tomcat home directory. Is it C:\Tomcat 5.0? What is your tomcat manager username? Is it admin? What is the manager password? Is it admin?
If you need to set up Tomcat’s admin username and password, go to Tomcat home directory, go to subdirectory conf. Use one editor to edit tomcat-users.xml file. You should have these three lines in tomcat-users.xml file:
<role rolename=anager/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manager"/>
Ok, now you can go to Eclipse workspace, program folder. You need to update some variables in build.properties file. Here we have:
tomcat.home=C:\Tomcat 5.0 tomcat.manager.url=http://localhost:8080/manager tomcat.manager.username=admin tomcat.manager.password=admin
Finally you can test ANT.
C:\EclipseWorkspace\program> ant compile


