Linux HOWTOs

About | Home | Search

ERROR: Slooooow dooooown... this page load was delayed.

HOWTO: ant
Description: Java based build tool
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# Apache Ant 1.7.0
# ================
# Prerequisites:
# JDK (Java Development Kit)

test -f installed/apache-ant-1.7.0-src.tar.bz2 &&
 mv installed/apache-ant-1.7.0-src.tar.bz2 .
test ! -f apache-ant-1.7.0-src.tar.bz2 &&

# Verify tarball w/ md5sum:
echo "22b378e27ab300e4d73bf09d91c7e2a6  apache-ant-1.7.0-src.tar.bz2" | \
 md5sum -c

# Verify tarball w/ sha1sum:
echo "3f01c35265ba50a49caafe1fb34ec8998bf45eb3  apache-ant-1.7.0-src.tar.bz2" | \
 sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 265B4C63 > /dev/null 2>&1 || gpg --recv-keys 265B4C63 ) &&
 wget -nc\
  gpg --verify apache-ant-1.7.0-src.tar.bz2.asc &&
   rm apache-ant-1.7.0-src.tar.bz2.asc

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "apache-ant-*" -exec rm -r {} \;
tar xjvf ~/apache-ant-1.7.0-src.tar.bz2
cd apache-ant-1.7.0
test $UID = 0 && chown -R root:root .
chmod -R u+w .

# Make sure $JAVA_HOME is set, this should've been taken care of when
# you installed the JDK

# Put JUnit in ./lib/optional/ or the build will fail
# (see
mkdir lib/optional
cd lib/optional
cd ../..

# Go here for info about other jar files that you may want to put in there:

# Become root

# Build and install it
./ -Ddist.dir=/usr/local/ant dist

# Create a /etc/profile.d/ to set $ANT_HOME
cat > /etc/profile.d/ << EOF
export ANT_HOME=/usr/local/ant
export PATH=\$PATH:\$ANT_HOME/bin
chmod 755 /etc/profile.d/

# Become yourself again

# Manually set ANT_HOME for your current shell
# (so you don't have to log out and in)
. /etc/profile.d/

mkdir -p -m 0700 installed
rm -f installed/apache-ant-*.tar.*
mv apache-ant-1.7.0-src.tar.bz2 installed/

Back to the list

Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>