hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daryn Sharp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-6605) Add JAVA_HOME detection to hadoop-config
Date Wed, 18 May 2011 21:06:47 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-6605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035669#comment-13035669
] 

Daryn Sharp commented on HADOOP-6605:
-------------------------------------

(My apologies on the neg.  I thought no number meant "I have general concerns but it's ok
if someone else +1s", whereas -1 meant "I think there's something really wrong I want addressed"
as in the path handling.)

Personally, I don't think it's too messy if hadoop knows how to make a few reasonable guesses,
based on conventions, for a few common OSes if JAVA_HOME isn't already set.  The tiny performance
impact is only taken by those that chose to not set JAVA_HOME.

Something like the following could be used to restrict the search path for the appropriate
os.  

{code}
case "$(uname -s)" in
  Darwin)
    candidates=($(/usr/libexec/java_home) /Library/Java/Home)
    ;;
  Windows)
    candidates=(...no idea...)
    ;;
  Linux)
    candidates=(/usr/java/default /usr/lib/jvm/default-java <maybe something "alternatives"
based> ...)
    ...
    ;;
esac
{code}


> Add JAVA_HOME detection to hadoop-config
> ----------------------------------------
>
>                 Key: HADOOP-6605
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6605
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Chad Metcalf
>            Assignee: Eli Collins
>            Priority: Minor
>             Fix For: 0.22.0
>
>         Attachments: HADOOP-6605.patch, hadoop-6605-1.patch
>
>
> The commands that source hadoop-config.sh currently bail with an error if JAVA_HOME is
not set. Let's detect JAVA_HOME (from a list of locations on various OS types) if JAVA_HOME
is not already set by hadoop-env.sh or the environment. This way users don't have to manually
configure it.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message