hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oj...@doc.ic.ac.uk
Subject Re: Newbie question...with appropriate apologies in advance...
Date Thu, 26 Jul 2007 22:22:21 GMT
Hi, can you show the output of "%> jar tf WordCount.jar". I'm  
wondering whether you've jarred it nested in any package folders that  
need to be written on the command line eg.
bin/hadoop jar WordCount.jar WordCount  
org/apache/hadoop/examples/WordCount dir dir

Quoting C G <parallelguy@yahoo.com>:

> I've deployed hadoop-0.13.0 and successfully run some examples.  Now  
>  I am trying to compile and run the examples prior to starting to   
> develop my own code.  I've managed to do little more than get a nice  
>  spew of error messages.  This is no doubt due to my own ignorance   
> and too much Python programming, but can anybody tell me how to   
> compile the examples (WordCount.java for example) and run them?
>   I apologize for the basic question, which I am sure is   
> classpath-magic related.  Any assistance most appreciated.  I   
> promise to be helpful to other newbs like myself going forward.
>   I've tried a bunch of stuff, but it all comes down to various   
> "can't find class X' errors.  This is representative of as far as   
> I've gotten:
>   % java -version
>   java version "1.6.0_02"
> Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
> Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing
>   % cd ${HADOOP_HOME}/hadoop-0.13.0/src/examples/org/apache/hadoop/examples
>   % javac -classpath   
> ${HADOOP_HOME}/hadoop-0.13.0/hadoop-0.13.0-core.jar WordCount.java
>   % jar -cvf WordCount.jar *.class
>   % cp *.jar ${HADOOP_HOME/hadoop-0.13.0/
>   % cd ${HADOOP_HOME/hadoop-0.13.0/
>   % bin/hadoop jar WordCount.jar WordCount input_files/text.txt   
> output_files/results2.txt
> Exception in thread "main" java.lang.NoClassDefFoundError: WordCount  
>  (wrong name: org/apache/hadoop/examples/WordCount)
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at   
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:247)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> ---------------------------------
> Luggage? GPS? Comic books?
> Check out fitting  gifts for grads at Yahoo! Search.

View raw message