title: Exception in thread “main” java.lang.ClassNotFoundException:MaxTemperature
body: <p>I am running a single node hadoop, after trying to run a mapreduce application I got this exception: </p>
  
  <p><code>Exception in thread "main" java.lang.ClassNotFoundException: src.main.java.com.hadoop.bi.MapReduce.MaxTemperature
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:270)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:201)</code> </p>
  
  <p>and what I ran in terminal was:</p>
  
  <p><code>[root@dev MapReduce]# hadoop jar target/MapReduce-0.0.1-SNAPSHOT.jar src/main/java/com/hadoop/bi/MapReduce/MaxTemperature sample.txt /out</code></p>
  
  <p>and here is my MaxTempreture class content:</p>
  
  <pre><code>    package com.hadoop.bi.MapReduce;
  import org.apache.hadoop.conf.Configuration;
  import org.apache.hadoop.fs.Path;
  import org.apache.hadoop.io.IntWritable;
  import org.apache.hadoop.io.Text;
  import org.apache.hadoop.mapreduce.Job;
  import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
  import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
  
  public class MaxTemperature {
  
    public static void main(String[] args) throws Exception {
      if (args.length != 2) {
        System.err.println("Usage: MaxTemperature &lt;input path&gt; &lt;output path&gt;");
        System.exit(-1);
      }
      Configuration conf = new Configuration();
      Job job = new Job(conf, "MaxTemperature");  
      job.setJarByClass(MaxTemperature.class);
  
  
      FileInputFormat.addInputPath(job, new Path(args[0]));
      FileOutputFormat.setOutputPath(job, new Path(args[1]));
  
      job.setMapperClass(MaxTemperatureMapper.class);
      job.setReducerClass(MaxTemperatureReducer.class);
  
      job.setOutputKeyClass(Text.class);
      job.setOutputValueClass(IntWritable.class);
  
      System.exit(job.waitForCompletion(true) ? 0 : 1);
    }
  }
  </code></pre>
  
  <p>I have followed most of similar problems on the internet but I haven't find the solution yet. Anyone know what the problem is and how it could be solved ? </p>