Reply
Highlighted
New Contributor
Posts: 1
Registered: ‎05-14-2018

Hadoop: Error Unsupported major.minor version 52.0 in Cloudera manager

I constructed Hadoop environment via Cloudera Manager. Then I executed MapReduce 2 program which is shown below(Not to be so long, I won't show Mapper and Reducer):

 

○WeatherAnalysisMain.java

 

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.compress.GzipCodec;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;


public class WeatherAnalysisMain {
    public static void main(String args[]) throws Exception{
        if(args.length != 2){
            System.err.println("Usage: WeatherAnalysis <input path> <output path>");
            System.exit(-1);
        }
        Job job = new Job();
job.setJarByClass(WeatherAnalysisMain.class);
job.setJobName("Weather Analysis"); FileInputFormat.addInputPath(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1]));
job
.setMapperClass(WeatherAnalysisMapper.class);
job.setCombinerClass(WeatherAnalysisReducer.class);
job.setReducerClass(WeatherAnalysisReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class); FileOutputFormat.setCompressOutput(job, true); FileOutputFormat.setOutputCompressorClass(job, GzipCodec.class); System.exit(job.waitForCompletion(true) ? 0 : 1); } }

 

I built this program by `gradle build`, and executed on Cloudera Manager server `hadoop jar <jar> input output`.

Then the error "Unsupported major.minor version 52.0" has occurred.

I know that the cause of this error is a mismatch of java version between Hadoop and this program. So I checked java version `java -version` returns `java version "1.8.0_171"` and `which java` returns `/usr/bin`. I specified "java home directory" in Cloudera Manager host setting "/bin/java".

Are there any problems? Or are there another method to run mapreduce program?

Thanks

Announcements