Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # user >> Hadoop Java compilation error


Copy link to this message
-
RE: Hadoop Java compilation error
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
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB