Apache Ant在Solaris 11上找不到tools.jar

时间:2014-04-21 08:42:34

标签: java ant solaris

我试图在Solaris 11上安装apache ant。

我设置了ANT_HOME,但我一直收到此错误:

Unable to locate tools.jar. Expected to find it in /usr/jdk/instances/jdk1.7.0/lib/tools.jar Buildfile: build.xml does not exist! Build failed

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

听起来你要么没有安装Java JDK,要么你的JAVA_HOME没有指向正确的位置:

假设您已配置公共Oracle Solaris存储库:

mack@solar:~# sudo pkg publisher
PUBLISHER                   TYPE     STATUS P LOCATION
solaris                     origin   online F http://pkg.oracle.com/solaris/release/

在Solaris上安装ant和Java JDK 8(在Solaris 11.3上测试):

sudo pkg install ant jdk-8

将JAVA_HOME指向JDK:

export JAVA_HOME=/usr/jdk/instances/jdk1.8.0

然后你可以测试你的ant安装:

mack@solar:~# ant
Buildfile: build.xml does not exist!
Build failed

至少你现在正确配置了蚂蚁。