title: Hadoop ClassNotFoundException
body: <p>I'm writing my 1st Hadoop application and I'm getting an error. I don't quite understand what some of the detials in this stack trace mean. It's a <code>ClassNotFoundException</code>. I'm building this on Ubuntu Linux v12.10, Eclipse 3.8.0, Java 1.6.0_24. I installed Hadoop by downloading it off the Apache site and building it with Ant. </p>
  
  <p>My crash is on the 1st line of the program when I'm creating a job. </p>
  
  <pre><code>public static void main(String[] args) throws IOException, InterruptedException,  ClassNotFoundException {
  
      Job job = new Job(); &lt;&lt;== crashing here.
  
  
  Program [Java Application]  
  com.sandbox.hadoop.Program at localhost:33878   
      Thread [main] (Suspended (exception ClassNotFoundException))    
          owns: Launcher$AppClassLoader  (id=29)  
          owns: Class&lt;T&gt; (org.apache.hadoop.security.UserGroupInformation) (id=25)    
          URLClassLoader$1.run() line: 217    
          AccessController.doPrivileged(PrivilegedExceptionAction&lt;T&gt;, AccessControlContext) line: not available [native method]   
          Launcher$AppClassLoader(URLClassLoader).findClass(String) line: 205 
          Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 321   
          Launcher$AppClassLoader.loadClass(String, boolean) line: 294    
          Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 266    
          DefaultMetricsSystem.&lt;init&gt;() line: 37  
          DefaultMetricsSystem.&lt;clinit&gt;() line: 34    
          UgiInstrumentation.create(Configuration) line: 51   
          UserGroupInformation.initialize(Configuration) line: 216    
          UserGroupInformation.ensureInitialized() line: 184  
          UserGroupInformation.isSecurityEnabled() line: 236  
          KerberosName.&lt;clinit&gt;() line: 79    
          UserGroupInformation.initialize(Configuration) line: 209    
          UserGroupInformation.ensureInitialized() line: 184  
          UserGroupInformation.isSecurityEnabled() line: 236  
          UserGroupInformation.getLoginUser() line: 477   
          UserGroupInformation.getCurrentUser() line: 463 
          Job(JobContext).&lt;init&gt;(Configuration, JobID) line: 80   
          Job.&lt;init&gt;(Configuration) line: 50  
          Job.&lt;init&gt;() line: 46   
          Program.main(String[]) line: 17 
  /usr/lib/jvm/java-6-openjdk-amd64/bin/java (Jan 14, 2013 2:42:36 PM)    
  </code></pre>
  
  <p>Console Output:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/configuration/Configuration
  at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.&lt;init&gt;(DefaultMetricsSystem.java:37)
  at org.apache.hadoop.metrics2.lib.DefaultMetricsSystem.&lt;clinit&gt;(DefaultMetricsSystem.java:34)
  at org.apache.hadoop.security.UgiInstrumentation.create(UgiInstrumentation.java:51)
  at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:216)
  at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:184)
  at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:236)
  at org.apache.hadoop.security.KerberosName.&lt;clinit&gt;(KerberosName.java:79)
  at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:209)
  at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:184)
  at org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled(UserGroupInformation.java:236)
  at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:477)
  at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:463)
  at org.apache.hadoop.mapreduce.JobContext.&lt;init&gt;(JobContext.java:80)
  at org.apache.hadoop.mapreduce.Job.&lt;init&gt;(Job.java:50)
  at org.apache.hadoop.mapreduce.Job.&lt;init&gt;(Job.java:46)
  at com.sandbox.hadoop.Program.main(Program.java:18)
  
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.Configuration
  at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
  ... 16 more
  </code></pre>