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

Philip Zeyliger commented on IMPALA-7161:
-----------------------------------------

This all sounds good to me. I think if there's a working java on the path, we 
should use it.

I found the following works for me:
{code}
export JAVA_HOME="$(jrunscript -e 
'java.lang.System.out.println(java.lang.System.getProperty("java.home"));')"
{code}

I think the {{readlink}} approach is good too.

> 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-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to