No love trying to build examples...any thoughts?
[cg ~]$ java -version
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Server VM (build 1.5.0_12-b04, mixed mode)
[cg ~]$ ant -version
Apache Ant version 1.7.0 compiled on December 13 2006
[cg ~]$ cd hadoop-0.13.0
[cg hadoop-0.13.0]$ ant examples
Buildfile: build.xml
init:
BUILD FAILED
/home/cg/hadoop-0.13.0/build.xml:116: Specify at least one source--a file or
resource collection.
Total time: 0 seconds
[cg hadoop-0.13.0]$
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.
>
---------------------------------
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search.