标签:enc 2.7 com 搜索 maven依赖 pac client group hadoop
Error:(37, 47) java: 无法访问org.apache.hadoop.mapred.JobConf 找不到org.apache.hadoop.mapred.JobConf的类文件
出现此异常,就是缺少相关的依赖包,你检查一下以下四个依赖包是否齐全:
hadoop-mapreduce-client-core-2.7.2.jar
hadoop-common-2.7.2.jar
hadoop-mapreduce-client-common-2.7.2.jar
hadoop-mapreduce-client-jobclient-2.7.2.jar
解决方案:
1.添加Maven依赖项,pom.xml
<dependencies> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-core</artifactId> <version>2.7.2</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>2.7.2</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-common</artifactId> <version>2.7.2</version> </dependency> <dependency> <groupId>org.apache.hadoop</groupId> <artifactId>hadoop-mapreduce-client-jobclient</artifactId> <version>2.7.2</version> </dependency> </dependencies>
2.手动下载jar
http://mvnrepository.com,用artifactId搜索对应的jar包,下载即可。
Error:(37, 47) java: 无法访问org.apache.hadoop.mapred.JobConf 找不到org.apache.hadoop.mapred.JobConf的类文件
标签:enc 2.7 com 搜索 maven依赖 pac client group hadoop
原文地址:https://www.cnblogs.com/ultimateWorld/p/10557514.html