users@glassfish.java.net

Ant Unable To Locate Tools.Jar

From: <glassfish_at_javadesktop.org>
Date: Sat, 08 Dec 2007 07:43:52 PST

In an effort to install Sun's Glassfish J2EE App Svr on Ubuntu 7.10 I ran into the following problem when executing:

root_at_JavaDev:/usr/local/glassfish# lib/ant/bin/ant -f setup.xml
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-sun-1.6.0.03/lib/tools.jar
Buildfile: setup.xml

all:

get.java.home:

setup.init:

check-java:

get.java.home:

setup.init:

validate-java:
[echo] Current Java Version 1.6.0_03

BUILD FAILED
/usr/local/glassfish/setup.xml:156: The following error occurred while executing this line:
/usr/local/glassfish/setup.xml:136: The following error occurred while executing this line:
/usr/local/glassfish/setup.xml:132: Please set java.home to a JDK installation

Total time: 7 seconds

I installed ant from the Ubuntu package archive...
root_at_JavaDev: apt-get install ant

I selected the latest version of Java (1.6.0.03)...
root_at_JavaDev: update-alternatives --config java

I edited the Java environment variables...
root_at_JavaDev. gksu gedit /etc/environment

JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.03"
CLASSPATH=".:/usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/rt.jar"
PATH="/usr/lib/jvm/java-6-sun-1.6.0.03/jre/sbin:/usr/lib/jvm/java-6-sun-1.6.0.03/jre/bin:/usr/sbin:/usr/bin:/sbin:/bin:/us r/games"

And Ant still can not find the tools.jar! I searched the entire file system and can not find tools.jar. Any suguests would be appreciated.

Thanks.

Chris
[Message sent by forum member 'chris55' (chris55)]

http://forums.java.net/jive/thread.jspa?messageID=249185