title: setJarByClass() in Hadoop
body: <p>At some point in the driver method of an Hadoop algorithm we link the job to  the references of the classes set as Mapper and Reducer. For example:</p>
  
  <pre><code>        job.setMapperClass(MyMapper.class);
          job.setReducerClass(MyReducer.class);
  </code></pre>
  
  <p>usually the driver method is the <code>main</code> while mapper and reducer are implemented as inner static classes. </p>
  
  <p>Suppose that <code>MyMapper.class</code> and <code>MyReducer.class</code> are inner static classes of <code>MyClass.class</code> and that driver method is the main of <code>MyClass.class</code>. Sometime I see the following line added right after the two from above:</p>
  
  <pre><code>        job.setJarByClass(Myclass.class);
  </code></pre>
  
  <p>what is the meaning of this configuration step and when it is useful or mandatory?</p>
  
  <p>In my case (I have a single-node cluster installation), If I remove this line, I can continue to run the job correctly. Why?</p>