Ree
Ree

Reputation: 903

Apache Ant cannot find tools.jar on Solaris 11

I'm trying to install apache ant on Solaris 11.

I set ANT_HOME but I keep getting this error:

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

How do I resolve this?

Upvotes: 0

Views: 359

Answers (1)

jcmack
jcmack

Reputation: 239

Sounds like you either do not have a Java JDK installed or your JAVA_HOME is not pointing to the right place:

Assuming you have the public Oracle Solaris repository configured:

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

To install ant and Java JDK 8 on Solaris (tested on Solaris 11.3):

sudo pkg install ant jdk-8

Point JAVA_HOME to the JDK:

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

Then you can test your ant installation:

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

At least you now have ant configured correctly.

Upvotes: 1

Related Questions