hadoop-core.jar中不存在org.apache.hadoop.conf.Configuration [英] org.apache.hadoop.conf.Configuration does not exist in hadoop-core.jar
问题描述
import org.apache.hadoop.conf.Configuration;
我使用的是Cloudera CDH4.3.1,因此软件包版本应该是:
hadoop-2.0.0 + 1367
hbase-0.94.6 + 106
== 更新 ==
我的pom.xml如下所示:
<依赖关系> ;
< groupId> org.apache.hadoop< / groupId>
< artifactId> hadoop-core< / artifactId>
< version> 2.0.0-mr1-cdh4.3.1< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.hbase< / groupId>
< artifactId> hbase< / artifactId>
< version> 0.94.6-cdh4.3.1< / version>
< /依赖关系>
但是不知何故,在hadoop-core.jar中,我没有看到任何org.apache的存在。 hadoop.conf.Configuration。结果,导入并没有被Java明显解决。
将hadoop-common添加到您的pom.xml中
< dependency>
< groupId> org.apache.hadoop< / groupId>
< artifactId> hadoop-common< / artifactId>
< version> 2.0.0-cdh4.3.1< / version>
< /依赖关系>
I am writing an HBase client in Java. The first line, of coz, looks like this:
import org.apache.hadoop.conf.Configuration;
I am using Cloudera CDH4.3.1, so the package versions should be:
hadoop-2.0.0+1367
hbase-0.94.6+106
==Updated==
my pom.xml looks like this:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>2.0.0-mr1-cdh4.3.1</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase</artifactId>
<version>0.94.6-cdh4.3.1</version>
</dependency>
But somehow, in hadoop-core.jar, I am not seeing any existence of org.apache.hadoop.conf.Configuration. As the result of it, the import is not resolved by Java obviously.
Add hadoop-common to your pom.xml
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>2.0.0-cdh4.3.1</version>
</dependency>
这篇关于hadoop-core.jar中不存在org.apache.hadoop.conf.Configuration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!