Sunday, October 19, 2014

How to install Apache ANT

Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications.

How to install Apache ANT ?

Apache ANT is available in both Source and Binary Distribution.

Download the binary distribution  : http://ant.apache.org/bindownload.cgi
Download the source distribution : http://ant.apache.org/srcdownload.cgi

If we download the binary version no need to compile the source and install the ANT
  • Download the binary distribution version from Apache mirrors.
  • If we are using Linux and installed GNU tar installed  download apache-ant-1.9.4-bin.tar.gz
  • Copy to server location and gunzip it  gunzip apache-ant-1.9.4-bin.tar.gz
  • untar the file as tar -xvf apache-ant-1.9.4-bin.tar
  • set the PATH as export PATH=$PATH:/opt/Apache/apache-ant-1.9.4-bin
If we want to set the path permanently , add the below lines in your server profile

      vi .profile
      export PATH=$PATH:/opt/Apache/apache-ant-1.9.4-bin
  • Verify the ANT installation as below
    -bash-3.2$ ./ant -version
    Apache Ant(TM) version 1.9.4 compiled on April 29 2014

No comments:

Post a Comment