如何在Ubuntu 11.04上正确安装ant 1.8

如何在Ubuntu 11.04上正确安装ant 1.8

我尝试按照以下说明在 Ubuntu 11.04 机器上安装 ant 1.8:

http://www.thegeekwork.com/how-to-install-ant-1-8-2-using-ppa-on-ubuntu/

当我列出已安装的内容时,我得到以下内容:

$ dpkg -L ant
/.
/usr
/usr/bin
/usr/share
/usr/share/maven-repo
/usr/share/maven-repo/org
/usr/share/maven-repo/org/apache
/usr/share/maven-repo/org/apache/ant
/usr/share/maven-repo/org/apache/ant/ant
/usr/share/maven-repo/org/apache/ant/ant/1.8.2
/usr/share/maven-repo/org/apache/ant/ant/1.8.2/ant-1.8.2.pom
/usr/share/maven-repo/org/apache/ant/ant/debian
/usr/share/maven-repo/org/apache/ant/ant/debian/ant-debian.pom
/usr/share/maven-repo/org/apache/ant/ant-launcher
/usr/share/maven-repo/org/apache/ant/ant-launcher/1.8.2
/usr/share/maven-repo/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.pom
/usr/share/maven-repo/org/apache/ant/ant-launcher/debian
/usr/share/maven-repo/org/apache/ant/ant-launcher/debian/ant-launcher-debian.pom
/usr/share/maven-repo/org/apache/ant/ant-parent
/usr/share/maven-repo/org/apache/ant/ant-parent/1.8.2
/usr/share/maven-repo/org/apache/ant/ant-parent/1.8.2/ant-parent-1.8.2.pom
/usr/share/maven-repo/org/apache/ant/ant-parent/debian
/usr/share/maven-repo/org/apache/ant/ant-parent/debian/ant-parent-debian.pom
/usr/share/ant
/usr/share/ant/bin
/usr/share/ant/bin/ant
/usr/share/ant/bin/complete-ant-cmd.pl
/usr/share/ant/bin/antRun
/usr/share/ant/bin/antRun.pl
/usr/share/ant/bin/runant.pl
/usr/share/ant/lib
/usr/share/ant/etc
/usr/share/ant/etc/ant-bootstrap.jar
/usr/share/doc
/usr/share/doc/ant
/usr/share/doc/ant/copyright
/usr/share/doc/ant/README.gz
/usr/share/doc/ant/README.Debian
/usr/share/doc/ant/changelog.Debian.gz
/usr/share/man
/usr/share/man/man5
/usr/share/man/man5/build.xml.5.gz
/usr/share/man/man1
/usr/share/man/man1/ant.1.gz
/usr/share/java
/usr/share/java/ant-launcher-1.8.2.jar
/usr/share/java/ant-1.8.2.jar
/usr/bin/ant
/usr/share/maven-repo/org/apache/ant/ant/1.8.2/ant-1.8.2.jar
/usr/share/maven-repo/org/apache/ant/ant/debian/ant-debian.jar
/usr/share/maven-repo/org/apache/ant/ant-launcher/1.8.2/ant-launcher-1.8.2.jar
/usr/share/maven-repo/org/apache/ant/ant-launcher/debian/ant-launcher-debian.jar
/usr/share/ant/lib/ant-launcher.jar
/usr/share/ant/lib/ant.jar
/usr/share/java/ant-launcher.jar
/usr/share/java/ant.jar
/usr/share/java/ant-bootstrap.jar

这样看起来 ant 1.8 已经安装好了,但是我查看 ant 的版本时,得到的仍然是 ant 1.7:

$ /usr/bin/ant -version
Apache Ant version 1.7.0 compiled on December 13 2006

关于如何在这个盒子上获取 ant 1.8 有什么想法吗?

谢谢!

答案1

你确定你使用的是 11.04 吗?因为默认情况下,natty 使用的是 ant 1.8。如果你使用的是任何旧版本的 Ubuntu,那么你可以从 Ubuntu 存储库本身安装 ant,使用

sudo apt-get install ant1.8

如果您在 11.04 上遇到问题,请尝试删除 ant1.7。默认情况下,11.04 中的 ant 是 1.8.1。否则,如果您特别需要该 ppa 中的 ant1.8,您可以删除现有的 ant、ant1.7 并安装它。

相关内容