In order to run Hadoop program you will need it run it as follows:

$hadoop jar <jar-name>.jar <class-name>

Where:
class-name is comiled .class file with main() method
name-jar is a jar containing .class files

Compile your HelloWorld.java into HelloWorld.class. Create a jar file from 
HelloWorld.class and call it , say HW.jar

Then execute the program as follows:
$hadoop jar HW.jar HelloWorld

Happy Hadooping,
AK7

From: Robert Evans [mailto:[email protected]]
Sent: Wednesday, November 14, 2012 4:37 PM
To: [email protected]; R J
Subject: Re: Hadoop Java compilation error

Hadoop is not a java runtime environment it runs special map/reduce 
applications.  Go search for "how to write a hadoop program" and there will be 
lots of examples or you can pick up a book on Hadoop and that can help you with 
some examples too.

--Bobby

From: R J <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>, R J 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, November 14, 2012 3:00 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Hadoop Java compilation error

Hi All,
I installed Hadoop 1.0.4 on Cygwin and tried to run Java HelloWorld but I get 
exception error:
$ bin/hadoop javac HelloWorld.java
java.lang.NoClassDefFoundError: javac
Exception in thread "main"
$ echo $JAVA_HOME
/cygdrive/c/java
$ javac HelloWorld.java
$ java HelloWorld
Hello, World
I have set JAVA_HOME environment variable in hadoop-env.sh .
How do I make it work on hadoop?
Thank you.
NOTICE: This e-mail message and any attachments are confidential, subject to 
copyright and may be privileged. Any unauthorized use, copying or disclosure is 
prohibited. If you are not the intended recipient, please delete and contact 
the sender immediately. Please consider the environment before printing this 
e-mail. AVIS : le pr?sent courriel et toute pi?ce jointe qui l'accompagne sont 
confidentiels, prot?g?s par le droit d'auteur et peuvent ?tre couverts par le 
secret professionnel. Toute utilisation, copie ou divulgation non autoris?e est 
interdite. Si vous n'?tes pas le destinataire pr?vu de ce courriel, 
supprimez-le et contactez imm?diatement l'exp?diteur. Veuillez penser ? 
l'environnement avant d'imprimer le pr?sent courriel

Reply via email to