Hadoop Common
  1. Hadoop Common
  2. HADOOP-7205

automatically determine JAVA_HOME on OS X

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.22.0
    • Fix Version/s: 0.23.0
    • Component/s: None
    • Labels:
      None

      Description

      OS X provides a java_home command that will return the user's selected jvm. The hadoop-env.sh should use this command if JAVA_HOME is not set.

      1. HADOOP-7205.patch
        0.6 kB
        Daryn Sharp

        Issue Links

          Activity

          Hide
          Allen Wittenauer added a comment -

          -1

          a) We've been avoiding OS-specific changes in the shells for a very long time, including one to autodetect Java on various Linux distributions. I see no reason to reverse this now. I've said it before and I'll say it again: stuff like this should really go into an installer that modifies hadoop-env.sh, not part of the base executable.

          b) Given that Java is moving from Apple controlled to Oracle controlled on OS X, there is a very good chance this command will disappear in a future release.

          Show
          Allen Wittenauer added a comment - -1 a) We've been avoiding OS-specific changes in the shells for a very long time, including one to autodetect Java on various Linux distributions. I see no reason to reverse this now. I've said it before and I'll say it again: stuff like this should really go into an installer that modifies hadoop-env.sh, not part of the base executable. b) Given that Java is moving from Apple controlled to Oracle controlled on OS X, there is a very good chance this command will disappear in a future release.
          Hide
          Daryn Sharp added a comment -

          Point taken, I understand the concern, and I was not aware of this policy. I was following the motto "when in Rome, do as the Romans do". It's a standard practice on OS X to use java_home to get the user's selected jvm. The release notes that announce the deprecation of apple's jvms recommends the use of java_home so it's unlikely to disappear. If the command did disappear, nothing would break with this patch.

          Since I'm not aware of history of this policy, may I suggest that the env script sources another env script (only if it exists) that is determined based on uname? That will compartmentalize os specific logic while retaining certain luxuries expected on each OS.

          http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/NewandNoteworthy/NewandNoteworthy.html

          Show
          Daryn Sharp added a comment - Point taken, I understand the concern, and I was not aware of this policy. I was following the motto "when in Rome, do as the Romans do". It's a standard practice on OS X to use java_home to get the user's selected jvm. The release notes that announce the deprecation of apple's jvms recommends the use of java_home so it's unlikely to disappear . If the command did disappear, nothing would break with this patch. Since I'm not aware of history of this policy, may I suggest that the env script sources another env script (only if it exists) that is determined based on uname? That will compartmentalize os specific logic while retaining certain luxuries expected on each OS. http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/NewandNoteworthy/NewandNoteworthy.html
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12474321/HADOOP-7205.patch
          against trunk revision 1094750.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          -1 patch. The patch command could not apply the patch.

          Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/356//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12474321/HADOOP-7205.patch against trunk revision 1094750. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://hudson.apache.org/hudson/job/PreCommit-HADOOP-Build/356//console This message is automatically generated.
          Hide
          Eli Collins added a comment -

          This dupes HADOOP-6605, which handles java detection via looking for specific, standard java home's for various versions of Java (which may be used across OS types) rather than use an os-specific detection method (java_home in OSX).

          Agree with Allen that we avoid OS-specific changes when possible. There are places which care about host-specific and java-specific issues and these may require some host-specific/java-specific changes.

          Show
          Eli Collins added a comment - This dupes HADOOP-6605 , which handles java detection via looking for specific, standard java home's for various versions of Java (which may be used across OS types) rather than use an os-specific detection method (java_home in OSX). Agree with Allen that we avoid OS-specific changes when possible. There are places which care about host-specific and java-specific issues and these may require some host-specific/java-specific changes.

            People

            • Assignee:
              Daryn Sharp
              Reporter:
              Daryn Sharp
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development