找不到org.apache.hadoop.classification.interfaceaudience的cloudera hadoop类文件

hzbexzde  于 2021-06-03  发布在  Hadoop
关注(0)|答案(5)|浏览(982)

下面是我在编译这个wordcount.java文件时遇到的错误。

$javac -classpath /usr/lib/hadoop/hadoop-common-2.0.0-cdh4.0.1.jar:/usr/lib/hadoop/client/hadoop-mapreduce-client-core-2.0.0-cdh4.0.1.jar -d ~/wordcount /usr/lib/hadoop/wordcount_classes/WordCount.java
/usr/lib/hadoop/hadoop-common-2.0.0-cdh4.0.1.jar(org/apache/hadoop/fs/Path.class): 

warning: Cannot find annotation method 'value()' in type 'LimitedPrivate': class file for org.apache.hadoop.classification.InterfaceAudience not found
1 warning
new9mtju

new9mtju1#

解决此问题的步骤:
我创建了一个名为wordcount的目录( /home/cloudera/wordcount ).
补充 WordCount.java/home/cloudera/wordcount 目录。
在目录中,我运行了以下命令:

javac \
-cp /usr/lib/hadoop/\*:/usr/lib/hadoop/client-0.20/\*:/usr/lib/hadoop/lib/\* \
WordCount.java 
-d /home/cloudera/wordcount/wordcount_classes
3z6pesqy

3z6pesqy2#

hadoop-2.6.x中的fast(但不建议用于生产)是
unix/macos系统

$ javac -classpath .:$(mapred classpath):$CLASSPATH -d ~/wordcount /usr/lib/hadoop/wordcount_classes/WordCount.java
wwodge7n

wwodge7n3#

对于hadoop版本2.6.0,您需要添加以下JAR:
javac-classpath$hadoop\u home/share/hadoop/common/hadoop-common-2.6.0.jar:$hadoop\u home/share/hadoop/common/lib/hadoop-annotations-2.6.0.jar:$hadoop\u home/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.6.0.jar/path\u到您的\u java\u文件/wordcount.java

pbwdgjma

pbwdgjma4#

注解pom中的以下依赖项(如果有的话)

<dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-exec</artifactId>
        <version>1.2.1</version>
    </dependency>

然后启用hadoop注解

but5z9lq

but5z9lq5#

将hadoop-annotations-2.0.0-cdh4.0.1.jar添加到类路径

相关问题