Cloudera Hadoop file for org.apache.hadoop.classification.InterfaceAudience file not found

Here is the error I get when trying to compile this WordCount.java file.

$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
+5
source share
5 answers
+12
source

How I fixed this problem:

  • I created a directory called wordcount ( /home/cloudera/wordcount).
  • Added directory WordCount.javato /home/cloudera/wordcount.
  • Inside the directory, I ran the following command:

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

Hadoop 2.6.0 :

javac -classpath $ HADOOP_HOME / share / hadoop / common / hasoop-common-2.6.0.jar: $ HADOOP_HOME / share / hadoop / common / lib / hadoop-annotations-2.6.0.jar: $ HADOOP_HOME / share / hadoop / mapreduce / hadoop-mapreduce-client-core-2.6.0.jar / path_to_your_java_file / WordCount.java

+2
source

Fast (but not recommended for production) in hadoop-2.6.x

Unix / MacOS

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

Comment on the pom dependency below if you have one

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

And then turn on adoop annotations

0
source

All Articles