Sunday, August 23, 2015

Install Apache ANT on Linux Machine


Install Apache Ant 


1) Download   

    $ wget http://www.us.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.tar.gz


2) Extract using tar command

   
$ sudo tar xvfvz apache-ant-1.9.2-bin.tar.gz -C /opt

3) Check files if installed

    $ sudo ln -s /opt/apache-ant-1.9.2 /opt/ant


4) Setup ANT environment variable by creating file called ant.sh under /etc/profile.d/ directory.

    $ vi /etc/profile.d/ant.sh

5) Add the following contents:

    #!/bin/bash
    ANT_HOME=/opt/ant
    PATH=$ANT_HOME/bin:$PATH
    export PATH ANT_HOME
    export CLASSPATH=.

6) Save and close the file. Make it executable using the following command.

    $ chmod +x /etc/profile.d/ant.sh

7) Set the environment variables permanently by running the following command:

    $ source /etc/profile.d/ant.sh
8) Reboot your system.

9) Check the ant version using command:

    $ ant -version


10) Done

No comments:

Post a Comment