Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 0.23.0
    • Fix Version/s: None
    • Component/s: mrv2
    • Labels:
      None
    • Environment:

      OS/X, JAVA_HOME unset

      Description

      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

      $ bin/yarn resourcemanager
      Error: JAVA_HOME is not set.
      
      

      To make things more interesting, if you set the value in the shell, it still doesn't propagate down to the scripts

      $ 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
      

        Issue Links

          Activity

          Hide
          Steve Loughran added a comment -

          the workaround is to set it in your .profile file. Having it set in the shell you invoke yarn from is not sufficient.

          Show
          Steve Loughran added a comment - the workaround is to set it in your .profile file. Having it set in the shell you invoke yarn from is not sufficient.
          Hide
          Miguel Ping added a comment -

          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:

           
          Defaults	env_keep+="JAVA_HOME"
          

          You can alternatively enable it for a user:

           
          Defaults:myusrname	env_keep+="JAVA_HOME"
          
          Show
          Miguel Ping added a comment - 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: Defaults env_keep+="JAVA_HOME" You can alternatively enable it for a user: Defaults:myusrname env_keep+="JAVA_HOME"

            People

            • Assignee:
              Unassigned
              Reporter:
              Steve Loughran
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development