软件名 版本号
Ant 1.10.3

1.一键安装Ant的shell脚本:

  1. #!/bin/bash
  2. #apt-get update
  3. #apt-get install zip unzip
  4. wget -Pwget -P /opt https://coding.net/u/jamesz2011/p/ubuntu_lib1/git/raw/master/ant/apache-ant-1.10.3-bin.zip
  5. unzip /opt/apache-ant-1.10.3-bin.zip -d /opt/
  6. #set environment
  7. export ANT_HOME="/opt/apache-ant-1.10.3"
  8. if ! grep ANT_HOME="/opt/apache-ant-1.10.3" /etc/profile
  9. then
  10. echo "ANT_HOME=/opt/apache-ant-1.10.3" | sudo tee -a /etc/profile
  11. echo "export ANT_HOME" | sudo tee -a /etc/profile
  12. echo "PATH=${ANT_HOME}/bin:$PATH" | sudo tee -a /etc/profile
  13. echo "export PATH" | sudo tee -a /etc/profile
  14. fi
  15. source /etc/profile
  16. sudo ln -s /opt/apache-ant-1.10.3/bin/ant /usr/local/bin/ant
  17. ant -version
  18. echo "install ant is ok !!!"

2.install_ant.sh文件地址:

3.用法:


3.1.wget下载shell脚本

  1. #code
  2. wget https://coding.net/u/jamesz2011/p/ubuntu_lib1/git/raw/master/ant/install_ant.sh

3.2.chmod赋予“可运行”权限

  1. #code
  2. chmod a+x install_ant.sh

3.3.source运行install_ant.sh脚本

  1. #code
  2. source install_ant.sh

4.一键安装Ant成功的标志:

  1. #code
  2. #ant -version 验证Ant是否安装配置成功
  3. ant -version