First of all Ant already come with Mac OSX, but if you really need to install it or want to upgrade it, though, the best way would be to install it through
MacPorts (using
sudo port install apache-ant). To install it manually you can follow these simple steps:
- Download latest Ant build from: http://ant.apache.org/bindownload.cgi
- Check previous version of ant on your mac
ant --version
- Go to your downloads folder or folder where you downloaded Ant bundle.
- Extract the bundle
tar -xvzf apache-ant-1.8.1-bin.tar.gz
- Ensure that /usr/local exists; if not found can be created by
sudo mkdir -p /usr/local
- Copy it into /usr/local
sudo cp -rf apache-ant-1.8.1-bin /usr/local/apache-ant
- Add the new version of Ant to current terminal session
export PATH=/usr/local/apache-ant/bin:$PATH;
- Add the new version of Ant to future terminal sessions
echo 'export PATH=/usr/local/apache-ant/bin:$PATH' >> ~/.profile
本文介绍如何在MacOSX中手动安装或升级Ant。首先检查当前Ant版本,然后下载最新版Ant并解压到指定文件夹。通过修改路径变量确保Ant正确安装。
1109

被折叠的 条评论
为什么被折叠?



