JAVA_HOME hard variable on Linux

I am trying to start all hadoop daemons with the command

./start-all.sh 

from the host host cluster. As a result of execution several times issued

 starting namenode, logging to /export/hadoop-1.0.1/libexec/../logs/hadoop--namenode-one.out 192.168.1.10: starting datanode, logging to /export/hadoop-1.0.1/libexec/../logs/hadoop-hadoop-datanode-myhost2.out 192.168.1.10: Error: JAVA_HOME is not set. 

And this happened several times even after the 192.168.1.10 commands were executed on the virtual machine

 hadoop@myhost2 :~$ export JAVA_HOME=/opt/jdk1.7.0_06 

Please tell us how to fix the JAVA_HOME variable once and for all.

+4
source share
3 answers

Put the line export JAVA_HOME=/path/to/java at the beginning of your start -all.sh script, and this should do it.

+1
source

$ vi ~/.bash_proflle

add this line to the file

export JAVA_HOME=/opt/jdk1.7.0_06

which will make permanent changes to the JAVA_HOME environment variable.

+1
source

You also installed JAVA_HOME in the hadoop-env.sh file. What is in the directory $HADOOP_INSTALL/hadoop/conf hadoop. by default, the JAVA_HOME settings line is commented out

hadoop-env.sh - this file contains some settings of environment variables used by Hadoop. You can use them to influence some aspects of the Hadoop daemon, for example, where the log files are stored, the maximum amount of heap used, etc. The only variable you need to change in this file is JAVA_HOME

Or you can add it to the next file in your hadoop account.

 ~/.bash_proflle 
+1
source

All Articles