1、pom.xml错误:Missing artifact jdk.tools:jdk.tools:jar:1.7
jdk.tools:jdk.tools是与JDK一起分发的一个JAR文件,可以如下方式加入到Maven项目中:
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
2、hadoop-common依赖
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.6.0</version>
</dependency>
3、junit依赖
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
4、MapReduce依赖
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.6.0</version>
</dependency>
5、在Eclipse下新建maven project,如果出错,在当前项目的pom.xml中添加如下内容,刷新即可(需要有网络)
<dependencies>
<span style="white-space:pre"> </span> <dependency>
<span style="white-space:pre"> </span> <groupId>org.apache.maven.plugins</groupId>
<span style="white-space:pre"> </span> <artifactId>maven-resources-plugin</artifactId>
<span style="white-space:pre"> </span> <version>2.4.3</version>
<span style="white-space:pre"> </span> </dependency>
</dependencies>
6、HDFS需要的依赖
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.6.0</version>
</dependency>