1

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.

Mason
  • 11
  • 1
  • have you got a fix by now that you can share? – Jere Apr 18 '21 at 17:16
  • Does this answer your question? [Hadoop: bad execution compiling WordCount](https://stackoverflow.com/questions/52761411/hadoop-bad-execution-compiling-wordcount) – Jere Apr 18 '21 at 17:25
  • 1
    Unfortunately, I was not able to resolve the issue. However, I noticed that the compliation still completed successfully (i.e. a .jar file was still generated) and I was able to execute the WordCount application. Therefore, I just treated the 'errors' as 'warnings' – Mason Apr 19 '21 at 18:26
  • same thing happend to me. I tried compiling it directly via javac (as described in the other "possible duplicate"-Question I linked in my prev. comment) and I got the same jar just without the warnings. But still no idea why these warnings appeared – Jere Apr 20 '21 at 14:33

0 Answers0