1

我修改了一个名为 的文件compile.sh,我完全更改了文件的路径.jar。这是 compile.sh 原始文件:

rm dmtl.jar

javac -classpath ../hadoop-core-0.20.203.0.jar:../lib/commons-cli-1.2.jar:../lib/commons-logging-1.1.1.jar:commons-codec-1.2.jar MRStats.java MR_CannonicalCode.java 
MR_Pattern.java Util_functions.java MR_Serialize.java MyInputFormat.java mapperReader.java graphMining.java

jar -cvf dmtl.jar *.class

rm *.class

这是我修改后的compile.sh:

rm dmtl.jar

javac -classpath /usr/jars/hadoop-core-2.6.0-mr1-cdh5.4.2.jar:/usr/jars/commons-cli-1.2.jar:/usr/jars/commons-logging-1.1.1.jar:commons-codec-1.4.jar MRStats.java MR_CannonicalCode.java MR_Pattern.java Util_functions.java MR_Serialize.java MyInputFormat.java mapperReader.java graphMining.java

jar -cvf dmtl.jar *.class

rm *.class

当我运行 compile.sh 时,出现以下错误:

[cloudera@quickstart MIRAGE_version1]$ ./compile.sh
MyInputFormat.java:8: error: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configuration;
                             ^
MyInputFormat.java:9: error: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configured;
                             ^
MyInputFormat.java:10: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.FSDataInputStream;
                           ^
MyInputFormat.java:11: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.FileSystem;
                           ^
MyInputFormat.java:12: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.Path;
                           ^
MyInputFormat.java:13: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.IntWritable;
                           ^
MyInputFormat.java:14: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.NullWritable;
                           ^
MyInputFormat.java:15: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.Text;
                           ^
MyInputFormat.java:16: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.WritableComparable;
                           ^
MyInputFormat.java:30: error: cannot find symbol
import org.apache.hadoop.util.Tool;
                             ^
  symbol:   class Tool
  location: package org.apache.hadoop.util
MyInputFormat.java:31: error: cannot find symbol
import org.apache.hadoop.util.ToolRunner;
                             ^
  symbol:   class ToolRunner
  location: package org.apache.hadoop.util
MyInputFormat.java:37: error: cannot find symbol
    extends MultiFileInputFormat<NullWritable, Text>  {
                                 ^
  symbol: class NullWritable
MyInputFormat.java:37: error: cannot find symbol
    extends MultiFileInputFormat<NullWritable, Text>  {
                                               ^
  symbol: class Text
MyInputFormat.java:40: error: cannot find symbol
    public RecordReader<NullWritable,Text> getRecordReader(InputSplit split
                        ^
  symbol:   class NullWritable
  location: class MyInputFormat
MyInputFormat.java:40: error: cannot find symbol
    public RecordReader<NullWritable,Text> getRecordReader(InputSplit split
                                     ^
  symbol:   class Text
  location: class MyInputFormat
MyInputFormat.java:47: error: cannot find symbol
    implements RecordReader<NullWritable, Text> {
                            ^
  symbol:   class NullWritable
  location: class MyInputFormat
MyInputFormat.java:47: error: cannot find symbol
    implements RecordReader<NullWritable, Text> {
                                          ^
  symbol:   class Text
  location: class MyInputFormat
MyInputFormat.java:50: error: cannot find symbol
        private FileSystem fs;
                ^
  symbol:   class FileSystem
  location: class FilepathRecordReader
MyInputFormat.java:52: error: cannot find symbol
        private Path[] paths;
                ^
  symbol:   class Path
  location: class FilepathRecordReader
MyInputFormat.java:57: error: cannot find symbol
        public FilepathRecordReader(Configuration conf, MultiFileSplit split)
                                    ^
  symbol:   class Configuration
  location: class FilepathRecordReader
MyInputFormat.java:75: error: cannot find symbol
        public boolean next(NullWritable key, Text value) throws IOException {
                            ^
  symbol:   class NullWritable
  location: class FilepathRecordReader
MyInputFormat.java:75: error: cannot find symbol
        public boolean next(NullWritable key, Text value) throws IOException {
                                              ^
  symbol:   class Text
  location: class FilepathRecordReader
MyInputFormat.java:92: error: cannot find symbol
        public Text createValue() {
               ^
  symbol:   class Text
  location: class FilepathRecordReader
MyInputFormat.java:95: error: cannot find symbol
        public NullWritable createKey() {
               ^
  symbol:   class NullWritable
  location: class FilepathRecordReader
mapperReader.java:7: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.*;
^
mapperReader.java:8: error: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configuration;
                             ^
mapperReader.java:9: error: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configured;
                             ^
mapperReader.java:10: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.FSDataInputStream;
                           ^
mapperReader.java:11: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.FileSystem;
                           ^
mapperReader.java:12: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.Path;
                           ^
mapperReader.java:13: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.IntWritable;
                           ^
mapperReader.java:14: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.NullWritable;
                           ^
mapperReader.java:15: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.Text;
                           ^
mapperReader.java:16: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.WritableComparable;
                           ^
mapperReader.java:18: error: cannot find symbol
import org.apache.hadoop.util.ToolRunner;
                             ^
  symbol:   class ToolRunner
  location: package org.apache.hadoop.util
mapperReader.java:22: error: cannot access Closeable
    public class mapperReader extends MapReduceBase implements Mapper<NullWritable, Text, Text, BytesWritable>  {
           ^
  class file for org.apache.hadoop.io.Closeable not found
mapperReader.java:32: error: cannot find symbol
            public void map(NullWritable key, Text value, OutputCollector<Text, BytesWritable> output, Reporter reporter) throws IOException
                            ^
  symbol:   class NullWritable
  location: class mapperReader
mapperReader.java:32: error: cannot find symbol
            public void map(NullWritable key, Text value, OutputCollector<Text, BytesWritable> output, Reporter reporter) throws IOException
                                              ^
  symbol:   class Text
  location: class mapperReader
mapperReader.java:32: error: cannot find symbol
            public void map(NullWritable key, Text value, OutputCollector<Text, BytesWritable> output, Reporter reporter) throws IOException
                                                                          ^
  symbol:   class Text
  location: class mapperReader
mapperReader.java:32: error: cannot find symbol
            public void map(NullWritable key, Text value, OutputCollector<Text, BytesWritable> output, Reporter reporter) throws IOException
                                                                                ^
  symbol:   class BytesWritable
  location: class mapperReader
mapperReader.java:87: error: cannot find symbol
        class reducerReader extends MapReduceBase implements Reducer<Text, BytesWritable, Text, BytesWritable> {
                                                                     ^
  symbol: class Text
mapperReader.java:87: error: cannot find symbol
        class reducerReader extends MapReduceBase implements Reducer<Text, BytesWritable, Text, BytesWritable> {
                                                                           ^
  symbol: class BytesWritable
mapperReader.java:87: error: cannot find symbol
        class reducerReader extends MapReduceBase implements Reducer<Text, BytesWritable, Text, BytesWritable> {
                                                                                          ^
  symbol: class Text
mapperReader.java:87: error: cannot find symbol
        class reducerReader extends MapReduceBase implements Reducer<Text, BytesWritable, Text, BytesWritable> {
                                                                                                ^
  symbol: class BytesWritable
mapperReader.java:96: error: cannot find symbol
            public void reduce(Text symbol, Iterator<BytesWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                               ^
  symbol:   class Text
  location: class reducerReader
mapperReader.java:96: error: cannot find symbol
            public void reduce(Text symbol, Iterator<BytesWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                                                     ^
  symbol:   class BytesWritable
  location: class reducerReader
mapperReader.java:96: error: cannot find symbol
            public void reduce(Text symbol, Iterator<BytesWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                                                                                            ^
  symbol:   class Text
  location: class reducerReader
mapperReader.java:96: error: cannot find symbol
            public void reduce(Text symbol, Iterator<BytesWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                                                                                                  ^
  symbol:   class BytesWritable
  location: class reducerReader
graphMining.java:6: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.*;
^
graphMining.java:9: error: package org.apache.hadoop.fs does not exist
import org.apache.hadoop.fs.FSDataInputStream;
                           ^
graphMining.java:12: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.IntWritable;
                           ^
graphMining.java:13: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.NullWritable;
                           ^
graphMining.java:14: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.LongWritable;
                           ^
graphMining.java:16: error: package org.apache.hadoop.io does not exist
import org.apache.hadoop.io.WritableComparable;
                           ^
graphMining.java:19: error: cannot find symbol
import org.apache.hadoop.util.ToolRunner;
                             ^
  symbol:   class ToolRunner
  location: package org.apache.hadoop.util
graphMining.java:22: error: package org.apache.hadoop.io.compress does not exist
import org.apache.hadoop.io.compress.CodecPool;
                                    ^
graphMining.java:23: error: package org.apache.hadoop.io.compress does not exist
import org.apache.hadoop.io.compress.CompressionCodec;
                                    ^
graphMining.java:24: error: package org.apache.hadoop.io.compress does not exist
import org.apache.hadoop.io.compress.Compressor;
                                    ^
graphMining.java:27: error: cannot find symbol
public class graphMining extends Configured implements Tool {
                                 ^
  symbol: class Configured
graphMining.java:27: error: cannot find symbol
public class graphMining extends Configured implements Tool {
                                                       ^
  symbol: class Tool
graphMining.java:30: error: cannot find symbol
    public static class mapperMiner extends MapReduceBase implements Mapper<Text, BytesWritable, Text, MapWritable> {
                                                                            ^
  symbol:   class Text
  location: class graphMining
graphMining.java:30: error: cannot find symbol
    public static class mapperMiner extends MapReduceBase implements Mapper<Text, BytesWritable, Text, MapWritable> {
                                                                                  ^
  symbol:   class BytesWritable
  location: class graphMining
graphMining.java:30: error: cannot find symbol
    public static class mapperMiner extends MapReduceBase implements Mapper<Text, BytesWritable, Text, MapWritable> {
                                                                                                 ^
  symbol:   class Text
  location: class graphMining
graphMining.java:30: error: cannot find symbol
    public static class mapperMiner extends MapReduceBase implements Mapper<Text, BytesWritable, Text, MapWritable> {
                                                                                                       ^
  symbol:   class MapWritable
  location: class graphMining
graphMining.java:40: error: cannot find symbol
            public void map(Text key, BytesWritable value, OutputCollector<Text, MapWritable> output, Reporter reporter) throws IOException
                            ^
  symbol:   class Text
  location: class mapperMiner
graphMining.java:40: error: cannot find symbol
            public void map(Text key, BytesWritable value, OutputCollector<Text, MapWritable> output, Reporter reporter) throws IOException
                                      ^
  symbol:   class BytesWritable
  location: class mapperMiner
graphMining.java:40: error: cannot find symbol
            public void map(Text key, BytesWritable value, OutputCollector<Text, MapWritable> output, Reporter reporter) throws IOException
                                                                           ^
  symbol:   class Text
  location: class mapperMiner
graphMining.java:40: error: cannot find symbol
            public void map(Text key, BytesWritable value, OutputCollector<Text, MapWritable> output, Reporter reporter) throws IOException
                                                                                 ^
  symbol:   class MapWritable
  location: class mapperMiner
graphMining.java:113: error: cannot find symbol
        public static class reducerMiner extends MapReduceBase implements Reducer<Text, MapWritable, Text, BytesWritable> {
                                                                                  ^
  symbol:   class Text
  location: class graphMining
graphMining.java:113: error: cannot find symbol
        public static class reducerMiner extends MapReduceBase implements Reducer<Text, MapWritable, Text, BytesWritable> {
                                                                                        ^
  symbol:   class MapWritable
  location: class graphMining
graphMining.java:113: error: cannot find symbol
        public static class reducerMiner extends MapReduceBase implements Reducer<Text, MapWritable, Text, BytesWritable> {
                                                                                                     ^
  symbol:   class Text
  location: class graphMining
graphMining.java:113: error: cannot find symbol
        public static class reducerMiner extends MapReduceBase implements Reducer<Text, MapWritable, Text, BytesWritable> {
                                                                                                           ^
  symbol:   class BytesWritable
  location: class graphMining
graphMining.java:121: error: cannot find symbol
            public void reduce(Text symbol, Iterator<MapWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                               ^
  symbol:   class Text
  location: class reducerMiner
graphMining.java:121: error: cannot find symbol
            public void reduce(Text symbol, Iterator<MapWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                                                     ^
  symbol:   class MapWritable
  location: class reducerMiner
graphMining.java:121: error: cannot find symbol
            public void reduce(Text symbol, Iterator<MapWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                                                                                          ^
  symbol:   class Text
  location: class reducerMiner
graphMining.java:121: error: cannot find symbol
            public void reduce(Text symbol, Iterator<MapWritable> values, OutputCollector<Text, BytesWritable> output, Reporter reporter)
                                                                                                ^
  symbol:   class BytesWritable
  location: class reducerMiner
MyInputFormat.java:61: error: cannot find symbol
            fs = FileSystem.get(conf);
                 ^
  symbol:   variable FileSystem
  location: class FilepathRecordReader
MyInputFormat.java:82: error: cannot find symbol
                Path file = paths[count];
                ^
  symbol:   class Path
  location: class FilepathRecordReader
MyInputFormat.java:83: error: cannot find symbol
                Text filepath = new Text(file.toString());
                ^
  symbol:   class Text
  location: class FilepathRecordReader
MyInputFormat.java:83: error: cannot find symbol
                Text filepath = new Text(file.toString());
                                    ^
  symbol:   class Text
  location: class FilepathRecordReader
MyInputFormat.java:93: error: cannot find symbol
            return new Text();
                       ^
  symbol:   class Text
  location: class FilepathRecordReader
MyInputFormat.java:96: error: cannot find symbol
            return NullWritable.get();
                   ^
  symbol:   variable NullWritable
  location: class FilepathRecordReader
*.class : no such file or directory
added manifest
rm: cannot remove `*.class': No such file or directory

我在相同的页面中发现我应该将 compile.sh 添加hadoop-mapreduce-client.jar到 compile.sh 中,但我hadoop-mapreduce-client.jar在我的版本中发现了很多CDH5.4。请帮我。

4

0 回答 0