stochasticcrap stochasticcrap - 7 months ago 28
Java Question

Running a Hadoop Map-Reduce Job

I am new with Hadoop and I am trying to run a word count job on a single node cluster that I recently installed on my desktop. I am following the tutorial below:

Currently I am stuck on step 3, and receive an error when I attempt to run:

~/development/Hadoop_projects/word_count$ mvn clean install

The error I get is:

Error: JAVA_HOME is not defined correctly.
We cannot execute usr/lib/jvm/java-7-openjdk-amd64/bin/java

I think i installed maven correctly, but have no idea. I am running this on ubuntu 14.04, any ideas on what to do about the java home path, or is there another issue going on here?


The above error was fixed by fixing the JAVA_HOME path, but now I get the following error once I run mvn clean install:

hduser@venus:~/development/Hadoop_projects/word_count$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.088s
[INFO] Finished at: Tue Jul 14 23:07:21 PDT 2015
[INFO] Final Memory: 5M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/hduser/development/Hadoop_projects/word_count). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

I created the pom.xml file in my word_count folder, but for some reason it is not being recognized when I run mvn. when I
ls word_count
there is no pom.xml in the directory, but I can see it in the Files gui window.


There is a terrific Ask Ubuntu article which explains in detail how you can set your JAVA_HOME environment variable. I am applying here the solution I found there, adapted for your particular setup.

Open /etc/environment in any editor and add the following line to the file:


Note carefully that I did not append bin/java to the path, which would be wrong. From a command prompt type the following to load the new environment variable:

source /etc/environment

Finally, verify that JAVA_HOME be set correctly by typing this in a command prompt: