Manual install
- Download a binary distribution from the official site;
- Ant isn't installed, just unzip it (for example to c:\ant)
- Configure the required environment variables:
Righ-Click "My Computer" -> Properties -> Advanced -> Press "Environment Variables" button
Ant will search for the JAVA_HOME environment variable if you don't have it create a new one.
NOTE: don't surround the path with "" ant wont be able to use it that way.
Example: JAVA_HOME C:\Program Files\Java\jdk1.6.0_37
Put the c:\ant\bin in your PATH variable
It may be a good idea to create a environment variable named ANT_HOME and then add that to the PATH variable:
ANT_HOME c:\ant\
PATH (append the bin folder to the string) ;%ANT_HOME%\bin
- Check that ant is running properly.
In a console type:
If you dont have a build.xml file on the current directory you should see the following output:C:\>ant Buildfile: build.xml does not exist! Build failed
Check the ant version:C:\>ant -version Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Using the java sdk update tool
If you instaled the java sdk you can use the update tool to install ant:In the update tools choose: Available add-ons -> Apache Ant build tool and install it;
You'll need to have your environment variables defined:
set the JAVA_HOME
Like the previous step, to use the ant command, edit and add ";as-install-parent/ant/bin" to your PATH environment variable (the default installation path is "C:\glassfish3\ant\bin").
Updating Ant
You should be able to update it using the "update tool" from the java sdk (as described in the top of this document).If not, you can manually download and substitute the existing ant files:
- Check your ant version from a console:
C:> ant -version
- Download a newer version from the official ant site;
- Find your ant folder: if you installed ant from the JavaEE jdk it resides in "C:\glassfish3\ant\";
- The system most certainly wont let you delete this folder (because its listed on your environment variables) but you can copy paste the new ant version files into it.
NOTE: its always a good idea to save a copy of the old files in case you find any problems with the new version. - Check your ant version again:
C:> ant -version
Sem comentários:
Enviar um comentário