码迷,mamicode.com
首页 > 编程语言 > 详细

配置hadoop-1.2.1出现localhost: Error: JAVA_HOME is not set.

时间:2016-07-10 13:52:30      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

配置hadoop-1.2.1出现localhost: Error: JAVA_HOME is not set.

具体为:

hadoop@dy-virtual-machine:~/hadoop-1.2.1$ start-all.sh
starting namenode, logging to /home/hadoop/hadoop-1.2.1/libexec/../logs/hadoop-hadoop-namenode-dy-virtual-machine.out
localhost: starting datanode, logging to /home/hadoop/hadoop-1.2.1/libexec/../logs/hadoop-hadoop-datanode-dy-virtual-machine.out
localhost: Error: JAVA_HOME is not set.
localhost: starting secondarynamenode, logging to /home/hadoop/hadoop-1.2.1/libexec/../logs/hadoop-hadoop-secondarynamenode-dy-virtual-machine.out
localhost: Error: JAVA_HOME is not set.
starting jobtracker, logging to /home/hadoop/hadoop-1.2.1/libexec/../logs/hadoop-hadoop-jobtracker-dy-virtual-machine.out
localhost: starting tasktracker, logging to /home/hadoop/hadoop-1.2.1/libexec/../logs/hadoop-hadoop-tasktracker-dy-virtual-machine.out
localhost: Error: JAVA_HOME is not set.

 

解决方法:

在/hadoop-1.2.1/conf/文件夹里有个hadoop-env.sh的文件,它的作用是配置与hadoop运行环境相关的变量

找到:

# The java implementation to use. Required.
# export JAVA_HOME=/usr/lib/jvm/java-6-sun

将#号去掉,变为:

技术分享

改成你本机的jdk路径,执行完退出

 :wq

 

若你不清楚自己的jdk路径,你可以先执行 echo $JAVA_HOME   进行查看 

技术分享

 

配置hadoop-1.2.1出现localhost: Error: JAVA_HOME is not set.

标签:

原文地址:http://www.cnblogs.com/nucdy/p/5657574.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!