zoukankan      html  css  js  c++  java
  • 配置hadoop-1.2.1出现localhost: Error: JAVA_HOME is not set.

    配置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   进行查看 

  • 相关阅读:
    MySQL技术内幕 InnoDB存储引擎 之 InnoDB体系架构
    ORACLE同义词使用
    五大好用的开源MySQL管理工具推荐
    MySQL Online DDL工具
    10046事件及其用法介绍
    MySQL表碎片清理
    MyRocks安装部署
    TiDB单机安装测试
    TiDB官方文档
    GoldenGate—AUTORESTART配置
  • 原文地址:https://www.cnblogs.com/nucdy/p/5657574.html
Copyright © 2011-2022 走看看