title: How to run a jar file in hadoop?
body: <p>I have created a jar file using the java file from <a href="http://java.dzone.com/articles/hadoop-basics-creating" rel="noreferrer">this blog</a> using following statements </p>
  
  <p><code>javac -classpath /usr/local/hadoop/hadoop-core-1.0.3.jar -d /home/hduser/dir Dictionary.java</code></p>
  
  <p><code>/usr/lib/jvm/jdk1.7.0_07/bin/jar cf Dictionary.jar /home/hduser/dir</code></p>
  
  <p>Now i have tried running this jar in hadoop by hit and trial of various commands </p>
  
  <p>1<code>hduser@ubuntu:~$ /usr/local/hadoop/bin/hadoop jar Dictionary.jar</code></p>
  
  <p>Output:</p>
  
  <pre><code>Warning: $HADOOP_HOME is deprecated.
  
  RunJar jarFile [mainClass] args...  
  </code></pre>
  
  <p>2.<code>hduser@ubuntu:~$ /usr/local/hadoop/bin/hadoop jar Dictionary.jar  Dictionary</code></p>
  
  <p>Output:</p>
  
  <pre><code>Warning: $HADOOP_HOME is deprecated.
  
  Exception in thread "main" java.lang.ClassNotFoundException: Dictionary
  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:423)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:264)
  at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
  </code></pre>
  
  <p>How can i run the jar in hadoop? I have the right DFS Locations as per needed by my program.</p>