title: How to bundle custom hadoop-streaming.jar
body: <p>I'm trying to use the <code>CombineFileInputFormat</code> class using Yelp's MrJob tool for EMR. The jobflow is created using hadoop streaming, and MrJob's documentation indicates the <code>CombineFileInputFormat</code> class must be bundled in a customized <code>hadoop-streaming.jar</code>.</p>
  
  <p>For context, please follow this <a href="https://stackoverflow.com/questions/14270317/implementation-for-combinefileinputformat-hadoop-0-20-205">question</a>.</p>
  
  <p>Specifically my question is: Where should the concrete class <code>CombinedInputFormat.class</code> be bundled or referenced within the <code>hadoop-streaming.jar</code>?</p>
  
  <p>I have tried bundling the <code>CombinedInputFormat.class</code> by adding it to a directory <code>org/apache/hadoop/streaming</code> and executing:</p>
  
  <pre><code>jar uvf my-hadoop-streaming.jar org/apache/hadoop/streaming
  </code></pre>
  
  <p>If I do that, the streaming jobflow starts, with the option <code>-inputformat CombinedInputFormat</code> the Job starts the first step and breaks, with error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/streaming/CombinedInputFormat (wrong name: CombinedInputFormat)
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
          ...
  </code></pre>
  
  <p>If I just try to set it in the root path with:</p>
  
  <pre><code>jar uvf my-hadoop-streaming.jar CombinedInputFormat.class
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>-inputformat : class not found : CombinedInputFormat
  Streaming Job Failed!
  </code></pre>
  
  <p>How should I bundle the CombinedInputFormat.class so that it will be correctly taken and solve the <code>NoClassDefFoundError</code> error?</p>