Home:ALL Converter>Error Compiling Hadoop WordCount MapReduce Example

Error Compiling Hadoop WordCount MapReduce Example

Ask Time:2021-02-06T12:27:07         Author:Mason

Json Formatter

I am consistently obtaining the same two errors when attempting to compile the WordCount.java source code provided here. I am working with Ubuntu Linux. I have searched vastly and everyone seems to conclude that changing the HADOOP_CLASSPATH environment variable as follows should do the trick but I still obtain the error. I have also included these environment variable definitions inside the haddop_env.sh file.

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=${JAVA_HOME}/bin:${PATH}
export HADOOP_CLASSPATH=${JAVA_HOME}/lib/tools.jar

However, it appears even with those variables set, I still obtain the following two errors after running the following compilation command:

bin/hadoop com.sun.tools.javac.Main WordCount.java

I obtain the errors:

HADOOP_COM.SUN.TOOLS.JAVAC.MAIN_USER: invalid variable name
HADOOP_COM.SUN.TOOLS.JAVAC.MAIN_OPTS: invalid variable name

I would appreciate any insight.

Author:Mason,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/66073564/error-compiling-hadoop-wordcount-mapreduce-example
yy