Driver class compilation error - hadoop Mapreduce

2014-10-26T13:50:06

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);

     }

Copyright License:
Author:「user2895589」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/26570205/driver-class-compilation-error-hadoop-mapreduce

About “Driver class compilation error - hadoop Mapreduce” questions

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:
I am trying to write data from hbase to hdfs and encountered this error in compilation. Is it problem with the reducer code or something else? HbaseFile.java:36: setReducerClass(java.lang.Class) i...
I am getting the error in the addInputPath method of my MapReduce Driver. The error is "The method addInputPath(Job, Path) in the type FileInputFormat is not applicable for the arguments (JobConf...
I am new to hadoop , i am following haddop definitive guide for learning. I was doing unit testing with MRunit, but while doing testing for reduce task i am facing compilation error. Below is my r...
I was trying to compile some Hadoop 2.3.0 mapreduce jobs in Eclipse. I imported the following jars hadoop-mapreduce-client-core-2.3.0.jar commons-cli-1.2.jar hadoop-common-2.3.0.jar However when...
The error which I am getting is as : 16/02/10 11:21:50 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 16/02/10 11...
I am consistently obtaining the same two errors when attempting to compile the WordCount.java source code provided here. I am working with Ubuntu Linux. I have searched vastly and everyone seems to
I am using Hadoop 2.9.1 standalone (the folder I am using is after successful compilation of the source code) and whenever I run a Hadoop command such as (where $HADOOP_HOME= /usr/local/hadoop, the
I have a driver program that launches a MapReduce job with org.apache.hadoop.mapreduce.Job.waitForCompletion(boolean) on Hadoop 2.4.0. The problem I have is if the driver program crashes in the mid...
I am trying to add another function to the code provided by hadoop apache https://hadoop.apache.org/docs/stable/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html#Partition...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.