Install Apache Ant
pergi ke laman web ini, http://ant.apache.org/ srcdownload.cgi
dan download file ini,
1.10.1 .tar.gz archive: apache-ant-1.10.1-src.tar.gz
kemudian kita unzip,
cd Downloads
~/Downloads$ sudo tar -zxvf apache-ant-1.10.1-src.tar.gz -C /usr/local
~/Downloads$ cd /usr/local
/usr/local$ ls -l
kita link-kan antara apache dengan ant
kita link-kan antara apache dengan ant
/usr/local$ sudo ln -s /usr/local/apache-ant-1.10.1/ /usr/local/ant
/usr/local$ ls -l
sebelum memulakannya, pastikan catat path yang betul bagi JAVA_HOME
periksa dengan comand ini,
echo $JAVA_HOME
/usr/local/java/jdk1.8.0_144 (sila catatkan utk setup env)
$ cd /etc/profile.d
/etc/profile.d$ sudo nano ant.sh
dan paste file ini ke nano
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH=${ANT_HOME}/bin:${PATH}
kita semak nano,
/usr/local/apache-ant-1.10.1$ cat ant.sh
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export JAVA_HOME=/usr/local/java/jdk1.8.0_144
export PATH=${ANT_HOME}/bin:${PATH}
cd /usr/local/ant
/usr/local/ant$ export ANT_HOME=/usr/local/ant
/usr/local/ant$ export PATH=${PATH}:${ANT_HOME}/bin
/usr/local/ant$ export JAVA_HOME=/usr/local/java/jdk1.8.0_144
/usr/local/ant$ export JAVA_HOME=/usr/local/java/jdk1.8.0_144
/usr/local/ant$ ant -version
Apache Ant(TM) 1.10.1 compiled on Februari 2 2017