Archive for 12 noviembre 2010

h1

Java error: Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar

12/11/2010

Si ocurre este error:

carlos@adscompc02:~/master/gimi/Distrib/InstanceMatcher$ ant build
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-6-openjdk/lib/tools.jar
Buildfile: build.xml
build:
[javac] Compiling 2 source files to /home/carlos/master/gimi/Distrib/InstanceMatcher/build/classes
BUILD FAILED
/home/carlos/master/gimi/Distrib/InstanceMatcher/build.xml:43: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre"
Total time: 0 seconds

Se soluciona localizando el paquete “tools.jar” y copiándolo a la ubicación donde “ant” lo está buscando:

carlos@adscompc02:~/master/gimi/Distrib/InstanceMatcher$ sudo find / -name tools.jar
/usr/lib/jvm/java-6-sun-1.6.0.22/lib/tools.jar
/usr/lib/jvm/java-1.5.0-gcj-4.4/lib/tools.jar
carlos@adscompc02:~/master/gimi/Distrib/InstanceMatcher$ sudo cp /usr/lib/jvm/java-6-sun-1.6.0.22/lib/tools.jar /usr/lib/jvm/java-6-openjdk/jre/lib/