0

我一直在尝试在我学校的实验室计算机上编译本书中的第一个示例,使用 HADOOP_CLASSPATH 变量和 javac 的 -classpath 标志,但无济于事。以下是我仍然收到的错误消息:

javac -verbose -classpath ~/Downloads/hadoop/share/hadoop/common/hadoop-common-2.0.4-alpha.jar:~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.0 .4-alpha.jar:~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.0.4-alpha.jar:~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce -client-common-2.0.4-alpha.jar:~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-hs-2.0.4-alpha.jar:~/Downloads/hadoop/share/hadoop /mapreduce/hadoop-mapreduce-client-jobclient-2.0.4-alpha-tests.jar:~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.0.4-alpha.jar:~/Downloads /hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.0.4-alpha.jar MaxTemperatureMapper.java

【解析开始RegularFileObject[MaxTemperatureMapper.java]】【解析完成13ms】【源文件搜索路径:/home/2013/rbokse/Downloads/hadoop/share/hadoop/common/hadoop-common-2.0.4-alpha.jar ,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.0 .4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce -client-hs-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.0.4-alpha-tests.jar,~/Downloads/hadoop/share /hadoop/mapreduce/hadoop-mapreduce-examples-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2.0.4-alpha.jar]

【类文件的搜索路径:/usr/lib/jvm/java-7-openjdk-i386/jre/lib/resources.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/rt .jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/sunrsasign.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jsse.jar,/ usr/lib/jvm/java-7-openjdk-i386/jre/lib/jce.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/charsets.jar,/usr/lib/ jvm/java-7-openjdk-i386/jre/lib/netx.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/plugin.jar,/usr/lib/jvm/java- 7-openjdk-i386/jre/lib/rhino.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/jfr.jar,/usr/lib/jvm/java-7-openjdk- i386/jre/classes,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/sunpkcs11.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ ext/sunjce_provider.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/localedata.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ ext/java-atk-wrapper.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/dnsns.jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/pulse-java。 jar,/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/zipfs.jar,/home/2013/rbokse/Downloads/hadoop/share/hadoop/common/hadoop-common-2.0. 4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-app-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce- client-core-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/ mapreduce/hadoop-mapreduce-client-hs-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.0.4-alpha-tests.jar,~/下载/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.0.4-alpha.jar,~/Downloads/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-shuffle-2。0.4-alpha.jar]

[加载 ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/io/IOException.class)]]

[加载 ZipFileIndexFileObject[/home/2013/rbokse/Downloads/hadoop/share/hadoop/common/hadoop-common-2.0.4-alpha.jar(org/apache/hadoop/io/IntWritable.class)]] [加载 ZipFileIndexFileObject [/home/2013/rbokse/Downloads/hadoop/share/hadoop/common/hadoop-common-2.0.4-alpha.jar(org/apache/hadoop/io/LongWritable.class)]]

[加载 ZipFileIndexFileObject[/home/2013/rbokse/Downloads/hadoop/share/hadoop/common/hadoop-common-2.0.4-alpha.jar(org/apache/hadoop/io/Text.class)]] MaxTemperatureMapper.java :8: 错误:包 org.apache.hadoop.mapreduce 不存在导入 org.apache.hadoop.mapreduce.Mapper;^ MaxTemperatureMapper.java:11:错误:找不到符号扩展 Mapper { ^ 符号:类映射器 MaxTemperatureMapper.java:16:错误:找不到符号公共无效映射(LongWritable 键,文本值,上下文上下文) ^ 符号:类上下文位置: 类 MaxTemperatureMapper

[加载 ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/InterruptedException.class)]]

[加载 ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Override.class)]]

[正在加载 ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)]] ...

[加载 ZipFileIndexFileObject[/usr/lib/jvm/java-7-openjdk-i386/lib/ct.sym(META-INF/sym/rt.jar/java/lang/Number.class)]] MaxTemperatureMapper.java:15 :错误:方法没有覆盖或实现超类型@Override ^ [total 170ms] 4个错误

任何帮助将不胜感激。

4

1 回答 1

1

尝试在你的论点中使用$HOME而不是。我确信这给我带来了问题。~-classpath

于 2013-05-20T22:40:38.267 回答