You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Miguel Ping (JIRA)" <ji...@apache.org> on 2012/08/29 14:02:08 UTC
[jira] [Commented] (MAPREDUCE-3432) Yarn doesn't work if JAVA_HOME
isn't set
[ https://issues.apache.org/jira/browse/MAPREDUCE-3432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443985#comment-13443985 ]
Miguel Ping commented on MAPREDUCE-3432:
----------------------------------------
My workaround (which is more of a fix) is to allow sudo to inherit some env variables. Edit the /etc/sudoers, and enable this behaviour:
{code:none}
Defaults env_keep+="JAVA_HOME"
{code}
You can alternatively enable it for a user:
{code:none}
Defaults:myusrname env_keep+="JAVA_HOME"
{code}
> Yarn doesn't work if JAVA_HOME isn't set
> ----------------------------------------
>
> Key: MAPREDUCE-3432
> URL: https://issues.apache.org/jira/browse/MAPREDUCE-3432
> Project: Hadoop Map/Reduce
> Issue Type: Bug
> Components: mrv2
> Affects Versions: 0.23.0
> Environment: OS/X, JAVA_HOME unset
> Reporter: Steve Loughran
> Priority: Minor
>
> libexec/hadoop-config.sh does reliably work out JAVA_HOME for many platforms. unfortunately, the yarn scripts don't use it. As such you get told off when you try to run yarn
> {code}
> $ bin/yarn resourcemanager
> Error: JAVA_HOME is not set.
> {code}
> To make things more interesting, if you set the value in the shell, it still doesn't propagate down to the scripts
> {code}
> $ echo $JAVA_HOME
> $ source libexec/hadoop-config.sh
> $ echo $JAVA_HOME
> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> $ bin/yarn resourcemanager
> Error: JAVA_HOME is not set.
> $echo $JAVA_HOME
> /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira