Vivek and everyone: Thanks for the info. I am just trying to build the
examples as a cheap proxy for how to write my own code.
I tried your suggestion, the result was 125 errors and a slew of warnings,
here's one for example:
[javac] 1. ERROR in
/home/CG/hadoop-0.13.0/src/java/org/apache/hadoop/record/compiler/CGenerator.java
(at line 42
)
[javac] void genCode(String name, ArrayList<JFile> ilist,
[javac] ^^^^^^^^^
[javac] The type ArrayList is not generic; it cannot be parameterized with
arguments <JFile>
Clearly there is something environmental I am doing wrong. I followed the
configuration instructions in the getting started guide, and it all worked from
the perspective of being able to run things out of the box.
Is there a guide or FAQ discussing building and deploying that I missed?
Any advice greatly appreciated. The map/reduce paradigm is super cool and I
can't wait to get past these operational issues and start laying down some code.
Thanks!
CG
Vivek Ratan <[EMAIL PROTECTED]> wrote:
NOt sure if I understand what you're trying to do. But,
- if you're modiying one of the examples and want to compile the modified
code, run 'ant examples' under ${HADOOP_HOME}/hadoop-0.13.0. (I assume
you're familiar with 'ant'). This will recreate the examples jar file (under
the build directory), which you can copy over the existing one. This is the
easiest way to compile your code as the root build.xml, which ant uses, sets
up all the right classpaths and other things for compilation.
- if you're creating examples of your own, you'll probably need to add your
class to org.apache.hadoop.example.ExampleDriver and then run ant.
> -----Original Message-----
> From: C G [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 26, 2007 3:00 PM
> To: [email protected]
> Subject: Newbie question...with appropriate apologies in advance...
>
> 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.
>
---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.