How to install apache ant on Fedora 8
Tags: ant, ant optional, ant-optional fedora, fedora, fedora 8, install ant
If you just want to run ant, install it using yum:
yum install ant
But if you need to execute the optional ant tasks like scp, junit, etc. you need to “install” ant manually. Please make sure that a java runtime is installed and the variable JAVA_HOME points to the root directory of the java installation.
Save this script as “install-ant.sh” and execute it as root:
yum install wget
cd /tmp
wget http://ftp.uni-erlangen.de/pub/mirrors/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz
tar xfz apache-ant-1.7.1-bin.tar.gz
mkdir /usr/share/ant
cp -r -f apache-ant-1.7.1/* /usr/share/ant/
export ANT_HOME=/usr/share/ant/
export PATH=$PATH:$ANT_HOME/bin
echo"
export ANT_HOME=/usr/share/ant
export PATH=$PATH:$ANT_HOME/bin:$JDK_HOME/bin
" >> /etc/profile
echo "apache ant has been installed."
exit;
If the script fails to download the tarball visit http://ant.apache.org/bindownload.cgi , coose another mirror and replace the url in the script above.