[ubuntu server 16.04下的安装脚本] 12.Ubuntu16.04一键安装Ant

软件名 版本号
Ant 1.10.3

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

#!/bin/bash  

#apt-get update
#apt-get install zip unzip

wget -Pwget -P /opt https://coding.net/u/jamesz2011/p/ubuntu_lib1/git/raw/master/ant/apache-ant-1.10.3-bin.zip

unzip /opt/apache-ant-1.10.3-bin.zip  -d /opt/

#set environment
export ANT_HOME="/opt/apache-ant-1.10.3"
if ! grep  ANT_HOME="/opt/apache-ant-1.10.3" /etc/profile 
then
    echo "ANT_HOME=/opt/apache-ant-1.10.3" | sudo tee -a /etc/profile
    echo "export ANT_HOME" | sudo tee -a /etc/profile
        echo "PATH=${ANT_HOME}/bin:$PATH" | sudo tee -a /etc/profile
        echo "export PATH" | sudo tee -a /etc/profile
        fi

source /etc/profile  


sudo ln -s /opt/apache-ant-1.10.3/bin/ant /usr/local/bin/ant



ant -version


echo "install ant is ok !!!"

2.install_ant.sh文件地址:


3.用法:

3.1.wget下载shell脚本
 #code
   
wget https://coding.net/u/jamesz2011/p/ubuntu_lib1/git/raw/master/ant/install_ant.sh
3.2.chmod赋予“可运行”权限
 #code
   
chmod a+x install_ant.sh
3.3.source运行install_ant.sh脚本
 #code
   
source install_ant.sh

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

 #code

#ant  -version   验证Ant是否安装配置成功
   
ant -version
4.ant -version 验证gradle是否安装配置成功

你可能感兴趣的:([ubuntu server 16.04下的安装脚本] 12.Ubuntu16.04一键安装Ant)