Buiding Hadoop with Eclipse / Maven-Missing artifact jdk.herramientas:jdk.herramientas:jar:1.6


Estoy tratando de importar la organización de cloudera.apache.hadoop: hadoop-cliente: 2.0.0-cdh4.0.0 desde cdh4 maven repo en un proyecto maven en eclipse 3.81, plugin m2e, con jdk 1.7.0_05 de oracle en win7 usando

<dependency>
    <groupId>org.apache.hadoop</groupId>
    <artifactId>hadoop-client</artifactId>
    <version>2.0.0-cdh4.0.0</version>
</dependency>

Sin embargo, obtengo el siguiente error:

The container 'Maven Dependencies' references non existing library 'C:\Users\MyUserId\.m2\repository\jdk\tools\jdk.tools\1.6\jdk.tools-1.6.jar'

Más específico, maven afirma que falta el siguiente artefacto

Missing artifact jdk.tools:jdk.tools:jar:1.6

Cómo resolver esto?

Author: ROMANIA_engineer, 2012-06-20

12 answers

jdk.tools:jdk.tools (o com.sun:tools, o como lo llames) es un archivo JAR que se distribuye con JDK. Normalmente lo agregas a proyectos maven como este:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <scope>system</scope>
    <systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>

Ver, el Maven FAQ para agregar dependencias a tools.jar

O bien, puede instalar manualmente tools.jar en el repositorio local usando:

mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true

Y luego referenciarlo como lo hizo Cloudera, usando:

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.6</version>
</dependency>
 87
Author: npe,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-04-19 18:29:05

El problema está en el soporte de Eclipse Maven, la pregunta relacionada es aquí.

En Eclipse, la variable java.home se establece en el JRE que se utilizó para iniciar Eclipse, no en el JRE de compilación. El JRE del sistema predeterminado de C:\Program Files no incluye el JDK, por lo que tools.jar no se encuentra.

Para solucionar el problema, debe iniciar Eclipse usando el JRE del JDK agregando algo como esto a eclipse.ini (antes -vmargs!):

-vm
C:/<your_path_to_jdk170>/jre/bin/server/jvm.dll

Luego actualice las dependencias Maven (Alt-F5) (Simplemente actualizar el proyecto no es suficiente).

 95
Author: rustyx,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 12:02:45

Gracias a npe, añadiendo

<dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.7.0_05</version>
    <scope>system</scope>
    <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>

A pom.xml hizo el truco.

 34
Author: jvataman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-06-20 11:14:07

Esto funcionó para mí:

dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.7.0_05</version>
    <scope>system</scope>
    <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
 6
Author: Ravi Macha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-22 18:10:03

Si puedes vivir sin herramientas.jar y solo se incluye como una dependencia encadenada, puede excluirlo del proyecto infractor:

<dependency>
    <groupId>org.apache.ambari</groupId>
    <artifactId>ambari-metrics-common</artifactId>
    <version>2.1.0.0</version>
    <exclusions>
        <exclusion>
            <artifactId>jdk.tools</artifactId>
            <groupId>jdk.tools</groupId>
        </exclusion>
    </exclusions>
</dependency>
 6
Author: Adam LaStrange,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-09 18:32:20

Tal vez el sistema instale el paquete jdk, pero tal vez algunas herramientas de desarrollo o plugin.

Encuentro este problema en opensuse env. e instalo java-1_6_0-openjdk-devel

El problema se ha solucionado..

 0
Author: liuyang1,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-12 15:18:07

También me enfrenté a este problema porque solo instalé JRE no con JDK. Por lo tanto, añadiendo dependencia para jdk.herramientas no puede arreglar para mí porque herramientas.jar no existía en mi directorio JAV{JAVA_HOME}/lib/.

Ahora he descargado e instalado JDK para arreglarlo.

 0
Author: Cataclysm,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-11-21 03:18:07

Cambia el conjunto de JRE instalados en tu eclipse. Ventana > Preferencias > Java > JREs instalados, cambiar la ubicación de jre a % JAVA_HOME% / jre, pero no algo como C:\Program Files \ Java\jre7

 0
Author: Sondy Woo,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-01-23 08:38:48

Si el jdk.herramientas está presente en el .repositorio m2. Todavía obtienes el error algo como esto:

Artefacto desaparecido: jdk.herramienta.....c:.../ jre/..

En el buildpath->configure build path Libraries>Libraries.Simplemente cambie la biblioteca del sistema JRE de JRE a JDK.

 0
Author: Divya Rakshu,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-10-09 07:49:18

Utilizo a continuación en mi proyecto de MR.

<exclusions>
                <exclusion>
                    <artifactId>jdk.tools</artifactId>
                    <groupId>jdk.tools</groupId>
                </exclusion>
</exclusions>
 0
Author: Suman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-04-26 22:44:00

Intenta:

Mvn install: install-file-DgroupId = jdk.herramientas-DartifactId = jdk.herramientas-Dversion = 1.6-Dpackaging = jar-Dfile = "C:\Program Archivos \ Java\jdk \ lib \ tools.jar "

Compruebe también : http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

 0
Author: Yogesh Borkhade,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-09-18 10:21:38

Ok, si está utilizando el sistema operativo Windows

  1. Ir a C:\Program Files\Java\jdk1.8.0_40\lib (la versión jdk podría ser diferente para ti)

  2. Asegúrese de herramientas.jar está presente (de lo contrario descargarlo)

  3. Copiar esta ruta "C:\Program Archivos\Java\jdk1.8.0_40"

  4. En pom.xml

    <dependency>
    <groupId>jdk.tools</groupId>
    <artifactId>jdk.tools</artifactId>
    <version>1.8.0_40</version>
    <scope>system</scope>
    <systemPath>C:/Program Files/Java/jdk1.8.0_40/lib/tools.jar</systemPath>
    </dependency>
    
  5. ¡Reconstruye y corre! ¡BINGO!

 -3
Author: Lokesh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-07-20 12:53:23