I am new to Hadoop and am following the book Hadoop: The Definitive Guide. I have installed Hadoop on my mac, which seems to have worked fine. I have set up a basic file system in HDFS (/user/nick). But I can't get the 'hadoop' command to execute a class file as required in Chapter 3 (p 56). It doesn't seem to be the file because the 'hadoop'command won't open even a simple file where where java command works fine. This is what my terminal looks like for the simple file:
Unix ~/Desktop $ java TestJava
Hello Test World
Unix ~/Desktop $ hadoop TestJava
Error: Could not find or load main class TestJava
All the other hadoop commands I have tried work fine (hadoop -ls, hadoop -copyFromLocal, hadoop -mkdir etc), but hadoop CLASSNAME doesn't work when the class file is saved on the desktop. I always get Error: Could not find or load main class TestJava.
Am I saving the class file in the wrong place or have I set up hadoop wrong?
I am new to this and have searched for an answer but couldn't find a solution. Any help would be much appreciated.
Thanks,
Nick