JDK版本的要求
- Hadoop 2.7 以及之后的版本,需要JDK 7;
- Hadoop 2.6 以及之前的版本,支持JDK 6;
对于Hadoop1.x.x版本,只需要引入1个jar:
- hadoop-core
对于Hadoop2.x.x版本,需要引入4个jar:
- hadoop-common
- hadoop-hdfs
- hadoop-mapreduce-client-core
- hadoop-client
- jdk.tools(一般需要引入,否则报错)
需要的Jar包 (对应版本:2.x.x)
<properties>
<hadoopVersion>2.5.2</hadoopVersion>
</properties>
<!-- Hadoop start -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoopVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>${hadoopVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>${hadoopVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoopVersion}</version>
</dependency>
<!-- Hadoop -->
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
</dependency>
需要的Jar包 (对应版本:1.2.1)
<properties>
<hadoopVersion>1.2.1</hadoopVersion>
</properties>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>${hadoopVersion}</version>
</dependency>
转载请标明出处:http://www.cnblogs.com/ssslinppp/