我怎么能在Mac OS X上安装Apache Ant的?
我想我的Mac上安装Apache Ant和我跟着下面的步骤:
I tried to install Apache Ant on my Mac and I followed the next steps :
- 我下载
Apache的ANT-1.8.1-bin.tar.gz
进入我的下载文件夹中。 - 我搬到文件到
的/ usr /本地/
使用这个命令:须藤SH
和MV的apache-ANT-1.8.1-bin.tar.gz在/ usr /本地/
- I downloaded
apache-ant-1.8.1-bin.tar.gz
into my Downloads folder. - I moved the file to
/usr/local/
using this commands :sudo sh
andmv apache-ant-1.8.1-bin.tar.gz /usr/local/
现在我想用 CD的/ usr /本地/
,但它不工作,我回来没有这样的文件或目录。
Now I want to use cd /usr/local/
but it's not working, I get back "No such file or directory".
然后我用 CD的/ usr /
和 LS
命令,似乎本地文件夹中是存在的。如果我试图访问它,我得到了同样的错误。
Then I used cd /usr/
and ls
commands and it seems that the local folder is there. If I try to access it I get the same error.
由于我已经用须藤苏
为什么我不能访问呢?任何想法?
Since I already used sudo su
why I can't access it? Any ideas?
蚂蚁上已经安装了一些老版本的Mac OS X的,所以你应该运行蚂蚁-version
以测试是否正在尝试安装前安装。
Ant is already installed on some older versions of Mac OS X, so you should run ant -version
to test if it is installed before attempting to install it.
如果尚未安装,那么你最好的选择是安装自制(酿造安装Ant
)或 MacPorts的( sudo的港口安装apache-蚁
),并使用这些工具来安装Apache Ant的。
If it is not already installed, then your best bet is to install Homebrew (brew install ant
) or MacPorts (sudo port install apache-ant
), and use those tools to install Apache Ant.
另外,虽然我会强烈建议使用自制或MacPorts的相反,你可以手动安装Apache Ant的。要做到这一点,你将需要:
Alternatively, though I would highly advise using Homebrew or MacPorts instead, you can install Apache Ant manually. To do so, you would need to:
- DECOM preSS .tar.gz文件。
- (可选)把它的地方。
- 把bin的子目录在你的路径。
这是你需要,假设 Apache的ANT-1.8.1-bin.tar.gz
(用实际版本替换1.8.1)的命令仍然在您的下载目录,将是以下(解释性意见包括):
The commands that you would need, assuming apache-ant-1.8.1-bin.tar.gz
(replace 1.8.1 with the actual version) were still in your Downloads directory, would be the following (explanatory comments included):
cd ~/Downloads # Let's get into your downloads folder.
tar -xvzf apache-ant-1.8.1-bin.tar.gz # Extract the folder
sudo mkdir -p /usr/local # Ensure that /usr/local exists
sudo cp -rf apache-ant-1.8.1-bin /usr/local/apache-ant # Copy it into /usr/local
# 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
# Verify new version of ant
ant -version