Maven搭建hadoop环境报Missing artifact jdk.tools:jdk.tools:jar:1.6

原文地址:http://blog.csdn.net/honglei915/article/details/38087959

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>



 

你可能感兴趣的:(maven,hadoop)