I have 3 .java file
1) Mapper.java
2) Reducer.java
3) Driver.java
I am trying to compile hadoop mapreduce program at command line using Driver class but it is showing below error
Driver.java:39: error: cannot find symbol
job.setMapperClass(Mapper.class);
^
symbol: class Mapper
location: class Driver
Driver.java:40: error: cannot find symbol
job.setReducerClass(Reducer.class);
How can I solve above error.Below is run method in Driver class
public boolean runnerParsing(String inputPath, String outputPath) throws IOException, ClassNotFoundException, InterruptedException {
Configuration conf = new Configuration();
Job job = new Job(conf, "Parsing");
job.setJarByClass(Driver.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(Text.class);
job.setMapperClass(Mapper.class);
job.setReducerClass(Reducer.class);
//job.setNumReduceTasks(0);
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
FileInputFormat.addInputPath(job, new Path(inputPath));
FileOutputFormat.setOutputPath(job, new Path(outputPath));
return job.waitForCompletion(true);
}
You will need to compile all java files as below:
javac -classpath /usr/local/hadoop/hadoop-core-1.2.1.jar -d compiled_classes Driver.java Mapper.java Reducer.java
Please note that your classpath value may change slightly depending on how you install Hadoop.
If you need further help, please have a look at this article which might help you: http://www.bigdatatutes.com/getting-started-with-big-data/
This is what i think:
Can you add your mapper and reducer class as well to question?