Hadoop: «ERROR : JAVA_HOME is not set»

前端 未结 12 1785
借酒劲吻你
借酒劲吻你 2020-12-13 17:13

I\'m trying to install Hadoop on Ubuntu 11.10. I set the JAVA_HOME variable in the file conf/hadoop-env.sh to:

# export JAVA_HOME=         


        
相关标签:
12条回答
  • 2020-12-13 17:44

    I tried the above solutions but the following worked on me

    export JAVA_HOME=/usr/java/default
    
    0 讨论(0)
  • 2020-12-13 17:46

    Here we provide simple steps to setup JAVA_HOME while installing of Hadoop

    Step1: Goto Java library path /lib jvm

    Then set the JAVA_HOME & PATH in .bashrc file

    Source : http://commandstech.com/hadoop-error-java_home-is-not-set-and-could-not-be-found-in-hadoop-installation/

    Step 2 : Once it is done then go with Hadoop env file then update it.

    After once it is done then stop the daemons and start daemons once again.

    0 讨论(0)
  • 2020-12-13 17:53

    The solution that worked for me was setting my JAVA_HOME in /etc/environment

    Though JAVA_HOME can be set inside the /etc/profile files, the preferred location for JAVA_HOME or any system variable is /etc/environment.

    Open /etc/environment in any text editor like nano or vim and add the following line:

    JAVA_HOME="/usr/lib/jvm/your_java_directory"
    

    Load the variables:

    source /etc/environment
    

    Check if the variable loaded correctly:

    echo $JAVA_HOME
    
    0 讨论(0)
  • 2020-12-13 17:53

    In some distributives(CentOS/OpenSuSe,...) will work only if you set JAVA_HOME in the /etc/environment.

    0 讨论(0)
  • 2020-12-13 17:57

    You should set JAVA_HOME in the hadoop-env.sh file also which is in the Hadoop configuration directory. By default the JAVA_HOME setting line is commented.

    0 讨论(0)
  • 2020-12-13 18:00

    Copy this export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk to hadoop-env.sh file.

    JAVA_HOME is the location where java binaries are present.

    0 讨论(0)
提交回复
热议问题