Alex Brodov
Alex Brodov

Reputation: 3515

installing Apache Ant 1.8.4 on centos

I want to install apache ant1.8.4 on my centos machine. I've read in the apache website but i didn't really understand how should i do tha. I didn't find the package on their website. Is there any option to use the yum install command?

Upvotes: 0

Views: 3815

Answers (2)

SMA
SMA

Reputation: 37103

Assuming you already have jdk installed, you could do the following:

cd $HOME
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.2-bin.tar.gz
tar xvfvz apache-ant-1.9.2-bin.tar.gz
In .bash_profile, add the following line
ANT_HOME=$HOME/apache-ant-1.9.2
PATH=$PATH:$ANT_HOME/bin
. ./.bashrc_profile
ant -version ##you should see version of ant.

(updated to 1.9.2 for wget)

Upvotes: 1

David W.
David W.

Reputation: 107090

There may be a way of installing Ant as a package. On the Apache Ant website, you do it manually. The tarball or zip provided has the entire Ant package installed. It's not that difficult:

  • Unzip or untar it to a special directory like /opt. I install all third party stuff in /opt on my system. Everything in the zip or tarball will be under the apache-ant-1.8.4 directory, so Ant will be under /opt/apache-ant-1.8.4.
  • In your .profile, set $ANT_HOME to where Ant was installed (/opt/apache-ant-1.8.4 in the above example. Then, add $ANT_HOME/bin to your $PATH.
  • Or, my preference, symbolically link all programs under /opt/apache-ant-1.8.4/bin to the /usr/local/bin directory and put that directory in the front of your PATH. This allows you to put all specially installed executables in one directory that can be placed in your $PATH.

That's about it. If you have the Ant executable (It's a shell script on Unix/Linux/Mac, and a batch script called ant.bat on Windows) in your PATH, it should work.

You mentioned you didn't have the Java Development Kit (JDK) installed. This must be installed first since Ant is a Java program. There must be a CENTOS package for Java. If not, you can try http://java.com/en/download/manual.jsp to download Java on your system.

Upvotes: 1

Related Questions