Hi Rohit,

 I really learned alot from this link:
http://www.infosci.cornell.edu/hadoop/windows.html

 Maha

Quoting Rohit Mishra <ro...@rohitmishra.me>:

I need clarification on how to run a Hadoop program. I am getting a
ClassNotFoundException error when I try to run the test example given in the
book [Ch 2].

Do we need to first compile the Java files into class files or will the
hadoop command do so automatically? How can we setup the HADOOP_CLASSPATH
variable. The book says "build/classes" Will the build directory be inside
the hadoop directory or under src?

I have placed the source .java files in /hadoop/me/rohitmishra/ch2

I have placed the input files for hadoop MaxTemperature
input/ncdc/sample.txt output directories inside /hadoop/input

When I run the command I get the following error:

ro...@renaissance1:~/hadoop-0.20.2$ hadoop MaxTemperature
input/ncdc/sample.txt output
Exception in thread "main" java.lang.NoClassDefFoundError: MaxTemperature
Caused by: java.lang.ClassNotFoundException: MaxTemperature
 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:307)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: MaxTemperature.  Program will exit.

Regards,
Rohit Mishra
VIT University

Blog: http://www.rohitmishra.me/blog
Twitter: http://twitter.com/movingahead
Facebook: http://www.facebook.com/rohitmishra




                     Thank you,

  Maha Alabduljalil
  m...@cs.ucsb.edu

Reply via email to