2
mark@maestro1:/usr/lib/hadoop/wordcount_classes$ 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 /usr/lib/hadoop/wordcount_classes /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
/usr/lib/hadoop/wordcount_classes/WordCount.java:14: error: error while writing Map: could not create parent directories
public static class Map extends MapReduceBase implements Mapper<LongWritable, Text, Text, IntWritable> {
            ^
1 error
1 warning

what is with this error? I cannot compile this wordcount.java file!

People have been telling me to set my java classpath correctly. Would anyone have any comment on how I go about this as well? Please help! Thanks!

user1663321
  • 75
  • 2
  • 5
  • Can you post some of the code... There are clearly mistakes. Set classpath: http://docs.oracle.com/javase/tutorial/essential/environment/paths.html – RossC Sep 20 '12 at 14:31

1 Answers1

4

This

-d /usr/lib/hadoop/wordcount_classes

indicates where you want the class files written. Is this correct ? I suspect you don't have permission to write there, hence:

error while writing Map: could not create parent directories

Can you create a directory in that directory (hint: use mkdir) ? I don't think the /usr/lib directory is a good place to do this, btw, even if you can. I would expect you to perform development within your home directory.

The /usr directory is usually used for installations of programs, libraries etc. and write-restricted for normal users. man hier gives a good explanation of the different directories used in Unix.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
  • Thanks ! That helped with the could not create parent directories! I changed it to a new folder called wordcount that is located in ~. Now why do i still get 1 warning? Here is what I got: – user1663321 Sep 20 '12 at 14:46
  • mark@maestro1:~$ 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 – user1663321 Sep 20 '12 at 14:47
  • @user1663321 - that's perhaps a different question more related to Hadoop. Glad the dir stuff worked – Brian Agnew Sep 20 '12 at 15:37