[
https://issues.apache.org/jira/browse/HADOOP-6605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037435#comment-13037435
]
Bharath Mundlapudi commented on HADOOP-6605:
--------------------------------------------
Most of the time, i do side-by-side jdk installations to see which jdk is
better. Many times, default jdk location is not preferred, Esp. as Allen
mentioned sometimes /usr/bin/java isn't Sun Java.
IMO, having .hadooprc file might be useful thing. Again, this file should be
part of the bundle. This is kind of creating virtual environment for hadoop
installation. This will solve multiple version problem also.
Sometimes, it is hard to know which jdk binary hadoop is using, part of the
reason is one can set JAVA_HOME at multiple locations like shell, hadoop-env.sh
etc Having consistent location for setting this also helpful. One has to do ps
cmd to figure out which location java is running from.
Also, having a helper script like checkhadoopenv.sh should let the user know
its current virtual environment. This will be useful for debugging purpose.
I think, we should have one consistent way to set environment for hadoop this
avoids user confusion.
Main point: set all the environment variables required for hadoop in .hadooprc
file defaulting to certain values. User can edit this file depending on his/her
case may be.
Defaulting env can be a tricky thing if user didn't set in .hadooprc. If this
happens, we should let user know that he/she should update .hadooprc file for
the missing env variables.
This file (.hadooprc) is user editable. We should document and make it the only
place users can tinker their environment. This avoids most of the confusion. Do
you agree?
> 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,
> hadoop-6605-2.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