Hi, I am new to Hadoop and started studying a couple of days ago. I just followed the instructions from Digital Ocean to set up a Hadoop cluster . Subsequently, I just tried a simple sample program called WordCount from Hadoop docs .
My hadoop version is 2.5.1, which is the same version as in the tutorial, and runs on Ubuntu Precise. I guarantee that I made the correct setup, as stated in the tutorial. Here's the end of my content ~ .bashrc .
... #HADOOP VARIABLES START export JAVA_HOME=/usr/lib/jvm/java-7-oracle export HADOOP_INSTALL=/usr/local/hadoop export PATH=$PATH:$HADOOP_INSTALL/bin export PATH=$PATH:$HADOOP_INSTALL/sbin export HADOOP_MAPRED_HOME=$HADOOP_INSTALL export HADOOP_COMMON_HOME=$HADOOP_INSTALL export HADOOP_HDFS_HOME=$HADOOP_INSTALL export YARN_HOME=$HADOOP_INSTALL export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib" export HADOOP_PREFIX=/usr/local/hadoop #HADOOP VARIABLES END
Also, I checked my java home configuration and the result looks below
sudo update-alternatives
So, I changed all the JAVA_HOME values ββin the bashrc and hadoop-env.sh files to /usr/lib/jvm/java-7-oracle . I also guarantee that Dfs and Yarn start.
However, when I compile WordCount.java using this command
hadoop com.sun.tools.javac.Main WordCount.java
Nothing goes my way. I got this error. Note that I use the Hadoop command instead of bin / hadoop, as the command works correctly, as it was defined in the bashrc file.
Error: Could not find or load main class com.sun.tools.javac.Main
What is the possible cause of this error and how to get rid of it? I think this may be a Javapathpath problem, but I still can not figure out the details. All workarounds for this problem relate to running a java or javac command, not hadoop .
I just want to run the sample program first before starting to learn how it works. Any help would be greatly appreciated. Thanks..