When I try to compile my program in Hadoop with this command
bin/hadoop com.sun.tools.javac.Main WordCounter.java
from Hadoop folder, it says
Error: Could not find or load main class com.sun.tools.javac.Main
I looked in similar threads where people suggested to check if JAVA_HOME
is properly stated. So in etc/hadoop/hadoop-env.sh
I added this line
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
then checked if tools.pack
is properly unpacked in /usr/lib/jvm/java-7-openjdk-amd64/lib
and it was. Then I tried javac -version
which gave
javac 1.7.0_65
I tried to reinstall Java but it didn't solve the problem.
Try to set HADOOP_CLASSPATH environment variable
export HADOOP_CLASSPATH=$JAVA_HOME/lib/tools.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With