title: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/Tool
body: <pre><code>I get below error when i package (jar) and run my defaulthadoopjob. 
  
  Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/Tool
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.Tool
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      ... 12 more
  Could not find the main class: DefaultHadoopJobDriver. Program will exit.
  
  
  Commands used to build Jar. 
  
  # jar -cvf dhj.jar 
  # hadoop -jar dhj.jar DefaultHadoopJobDriver
  
  The above command gave me error "Failed to load Main-Class manifest attribute from dhj.jar"
  
  rebuilt jar with manifest using below command
  </code></pre>
  
  <p>jar -cvfe dhj.jar DefaultHadoopJobDriver . <br>
     hadoop -jar dhj.jar DefaultHadoopJobDriver -- This returned the original error message that I reported above.</p>
  
  <p>My Hadoop job has single class "DefaultHoopJobDrive" that extends Configures and implements Tool, and run method as only code for Job creation and inputpath,outpurpath set.
  Aslo I.m using new API.</p>
  
  <pre><code>I'm running hadoop 1.2.1 and the Job works fine from eclipse.
  
  This might be something to do with the classpath. Please help.
  </code></pre>