我一直在研究 hadoop-2.4.0,为了运行基于 java 的 hadoop 示例,我已将所需的库放在 CLASSPATH
export HADOOP_HOME= /root/hadoop-binaries/hadoop-2.4.0
CLASSPATH=/root/hadoop-binaries/hadoop-2.4.0/conf
CLASSPATH=$CLASSPATH:$HADOOP_HOME/*:$HADOOP_HOME/lib/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../hadoop-mapreduce/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../hadoop-mapreduce/lib/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../hadoop-yarn/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../hadoop-yarn/lib/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../hadoop-hdfs/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../hadoop-hdfs/lib/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../common/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../common/lib/*
CLASSPATH=$CLASSPATH:$HADOOP_HOME/../tools/lib/*
我已将所有需要的 HADOOP 库从 HADOOP_HOME 添加到 CLASSPATH 中。
但是,当我尝试运行示例 javac -cp $CLASSPATH HelloWorld.java
它提醒我一个错误
HelloWorld.java:4: error: package org.apache.hadoop.conf does not exist
import org.apache.hadoop.conf.Configuration; ^
1 error
我不知道在哪里可以找到 org.apache.hadoop.conf 的库。