You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Joe McDonnell (JIRA)" <ji...@apache.org> on 2018/06/12 17:17:00 UTC

[jira] [Commented] (IMPALA-7161) Bootstrap's handling of JAVA_HOME needs improvement

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

Joe McDonnell commented on IMPALA-7161:
---------------------------------------

Additional issue:

Suppose a user sets JAVA_HOME in their environment like they are supposed to. Suppose they also have JAVA_HOME in bin/impala-config-local.sh like bin/bootstrap_system.sh writes. The two can get out of sync. The JAVA would be from the environment JAVA_HOME, but after setting JAVA, bin/impala-config-local.sh's value for JAVA_HOME would overwrite the environment variable and JAVA_HOME would be that value. These could point to two different places.

> Bootstrap's handling of JAVA_HOME needs improvement
> ---------------------------------------------------
>
>                 Key: IMPALA-7161
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7161
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Infrastructure
>    Affects Versions: Impala 2.13.0, Impala 3.1.0
>            Reporter: Joe McDonnell
>            Priority: Major
>
> bin/bootstrap_system.sh installs the Java SDK and sets JAVA_HOME in the current shell. It also adds a command to the bin/impala-config-local.sh to export JAVA_HOME there. This doesn't do the job.
> bin/impala-config.sh tests for JAVA_HOME at the very start of the script, before it has sourced bin/impala-config-local.sh. So, the user doesn't have a way of developing over the long term without manually setting up JAVA_HOME.
> bin/impala-config.sh also doesn't detect the system JAVA_HOME. For Ubuntu 16.04, this is fairly simple and if a developer has their system JDK set up appropriately, it would make sense to use it. For example:
>  
> {noformat}
> # If javac exists, then the system has a Java SDK (JRE does not have javac).
> # Follow the symbolic links and use this to determine the system's JAVA_HOME.
> if [ -L /usr/bin/javac ]; then
>   SYSTEM_JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:bin/javac::")
> fi
> export JAVA_HOME="${JAVA_HOME:-${SYSTEM_JAVA_HOME}}"{noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org