我一直在研究hadoop-2.4.0,为了运行基于java的hadoop示例,我在类路径上放置了所需的lib
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\u主页添加到类路径中。
但是,当我尝试运行示例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的lib。
1条答案
按热度按时间wkftcu5l1#
试试这些
打印类路径
回显$classpath
“导出”中有空间
导出hadoop\u home=“space”/root/hadoop二进制文件/hadoop-2.4.0
希望有帮助