我已经将hadoop-env.sh设置为:
# export JAVA_HOME=/usr/lib/jvm/java-6-sun
但在启动hadoop时仍然有相同的错误:
Warning: $HADOOP_HOME is deprecated.
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-namenode dyah-VirtualBox.out
localhost: starting datanode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-datanode-dyah-VirtualBox.out
localhost: Error: JAVA_HOME is not set.
localhost: starting secondarynamenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-secondarynamenode-dyah-VirtualBox.out
localhost: Error: JAVA_HOME is not set.
starting jobtracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-jobtracker-dyah-VirtualBox.out
localhost: starting tasktracker, logging to /usr/local/hadoop/libexec/../logs/hadoop-hduser-tasktracker-dyah-VirtualBox.out
localhost: Error: JAVA_HOME is not set.
我打字的时候 echo $JAVA_HOME
,它显示: /usr/lib/jvm/java-6-sun
. 我打字的时候 java -version
,它显示了java的版本。
我已经将java的路径导出到 /.bashrc
我不知道这里发生了什么,因为我已经根据教程正确地设置了东西。
2条答案
按热度按时间yptwkmov1#
是全局设置的环境变量,也就是说,它应该能够为启动hadoop的用户提供支持。尝试(以root用户身份)手动导出javau home,然后启动hadoop。
qkf9rpyu2#
export语句由一个前导语句注解掉
#
,所以没有效果。