Maven搭建Hadoop环境报Missing artifact jdk.tools:jdk.tools:
Maven引入Hadoop依赖报错:Missing artifact jdk.tools:jdk.tools:jar:1.6
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.4.0</version>
</dependency>
原因是缺少tools.jar的依赖,tools.jar在jdk的安装目录中提供了,所以改成如下形式解决此问题:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.4.0</version>
<exclusions>
<exclusion>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
下面关于Hadoop的文章您也可能喜欢,不妨看看: