jdk.tools:jdk.tools
(or com.sun:tools
, or whatever you name it) is a JAR file that is distributed with JDK. Usually you add it to maven projects like this:<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
Or, you can manually install
tools.jar
in the local repository using:mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dpackaging=jar -Dversion=1.6 -Dfile=tools.jar -DgeneratePom=true
and then reference it like Cloudera did, using:
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.6</version>
</dependency>
The problem is in the Eclipse Maven support, the related question is here.
Under Eclipse, the
java.home
variable is set to the JRE that was used to start Eclipse, not the build JRE. The default system JRE from C:\Program Files
doesn't include the JDK so tools.jar
is not being found.
To fix the issue you need to start Eclipse using the JRE from the JDK by adding something like this to
eclipse.ini
(before -vmargs
!):-vm
C:\<your_path_to_jdk170>\jre\bin\javaw.exe
Then refresh the Maven dependencies (Alt-F5) (Just refreshing the project isn't sufficient).
Read full article from java - Buiding Hadoop with Eclipse / Maven - Missing artifact jdk.tools:jdk.tools:jar:1.6 - Stack Overflow
No comments:
Post a Comment