hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kartashov, Andy" <Andy.Kartas...@mpac.ca>
Subject RE: Hadoop Java compilation error
Date Thu, 15 Nov 2012 14:21:42 GMT
In order to run Hadoop program you will need it run it as follows:

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

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,

From: Robert Evans [mailto:evans@yahoo-inc.com]
Sent: Wednesday, November 14, 2012 4:37 PM
To: user@hadoop.apache.org; 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.


From: R J <rj201244@yahoo.com<mailto:rj201244@yahoo.com>>
Reply-To: "user@hadoop.apache.org<mailto:user@hadoop.apache.org>" <user@hadoop.apache.org<mailto:user@hadoop.apache.org>>,
R J <rj201244@yahoo.com<mailto:rj201244@yahoo.com>>
Date: Wednesday, November 14, 2012 3:00 PM
To: "user@hadoop.apache.org<mailto:user@hadoop.apache.org>" <user@hadoop.apache.org<mailto:user@hadoop.apache.org>>
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
$ 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

View raw message