Hadoop 2.2.0 fails running start-dfs.sh with Error: JAVA_HOME is not set and could not be found
Alternatively you can edit /etc/environment
to include:
JAVA_HOME=/usr/lib/jvm/[YOURJAVADIRECTORY]
This makes JAVA_HOME
available to all users on the system, and allows start-dfs.sh
to see the value. My guess is that start-dfs.sh
is kicking off a process as another user somewhere that does not pick up the variable unless explicitly set in hadoop-env.sh
.
Using hadoop-env.sh
is arguably clearer -- just adding this option for completeness.