问题描述
我试图导入cloudera的 org.apache.hadoop:hadoop-client:2.0.0-cdh4.0.0 在eclipse 3.81,m2e插件的maven项目中,使用oracle7的jdk 1.7.0_05使用
< dependency>
< groupId> org.apache.hadoop< / groupId>
< artifactId> hadoop-client< / artifactId>
< version> 2.0.0-cdh4.0.0< / version>
< /依赖关系>
但是,我收到以下错误:
容器'Maven Dependencies'引用非现有的库'C:\ Users \MyUserId\.m2\repository\jdk\tools\jdk.tools\ 1.6 \jdk.tools-1.6.jar'
更具体,maven声明以下神器是失踪
失踪神器jdk.tools:jdk.tools:jar:1.6
如何解决这个问题?
jdk.tools:jdk.tools (或 com.sun:tools ,或者任何你命名的)是一个JAR文件,它是随JDK分发。通常你将它添加到像这样的maven项目中:
< dependency>
< groupId> jdk.tools< / groupId>
< artifactId> jdk.tools< / artifactId>
< scope>系统< / scope>
< systemPath> $ {java.home} /../ lib / tools.jar< / systemPath>
< /依赖关系>
请参阅
或,您可以使用以下方式在本地存储库中手动安装 tools.jar
$ p $ mvn install:install-file -DgroupId = jdk.tools -DartifactId = jdk.tools -Dpackaging = jar -Dversion = 1.6 -Dfile = tools.jar -DgeneratePom = true
,然后像Cloudera那样引用它:
<依赖性>
< groupId> jdk.tools< / groupId>
< artifactId> jdk.tools< / artifactId>
< version> 1.6< / version>
< /依赖关系>
I am trying to import cloudera's org.apache.hadoop:hadoop-client:2.0.0-cdh4.0.0 from cdh4 maven repo in a maven project in eclipse 3.81, m2e plugin, with oracle's jdk 1.7.0_05 on win7 using
<dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-client</artifactId> <version>2.0.0-cdh4.0.0</version> </dependency>
however, I get the following 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'
more specific, maven states that the following artifact is missing
Missing artifact jdk.tools:jdk.tools:jar:1.6
How to solve this?
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>
See, the Maven FAQ for adding dependencies to tools.jar
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>
这篇关于使用Eclipse / Maven构建Hadoop - 丢失神器jdk.tools:jdk.tools:jar:1.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!