无法编译WordCount.java [英] Cannot Compile WordCount.java
问题描述
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
这个错误?我无法编译此wordcount.java文件!
what is with this error? I cannot compile this wordcount.java file!
人们一直在告诉我正确设置Java类路径。有人会对我也如何发表意见吗?请帮忙!谢谢!
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!
推荐答案
此
-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
可以在该目录中创建目录(提示:使用 mkdir
)?我不认为 / usr / lib
目录是执行此操作的好地方,顺便说一句,即使可以。我希望您在主目录中执行开发。
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.
/ usr目录通常用于安装程序,库等,并且对普通用户具有写限制。 man hier
很好地解释了Unix中使用的不同目录。
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.
这篇关于无法编译WordCount.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!