Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 31FAC200BB8 for ; Sat, 8 Oct 2016 06:39:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 30D91160AE9; Sat, 8 Oct 2016 04:39:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 79329160AE8 for ; Sat, 8 Oct 2016 06:39:21 +0200 (CEST) Received: (qmail 73172 invoked by uid 500); 8 Oct 2016 04:39:20 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 73150 invoked by uid 99); 8 Oct 2016 04:39:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Oct 2016 04:39:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 873F52C0D53 for ; Sat, 8 Oct 2016 04:39:20 +0000 (UTC) Date: Sat, 8 Oct 2016 04:39:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-4870) drill-config.sh sets JAVA_HOME incorrectly for the Mac MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 08 Oct 2016 04:39:22 -0000 [ https://issues.apache.org/jira/browse/DRILL-4870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15557189#comment-15557189 ] ASF GitHub Bot commented on DRILL-4870: --------------------------------------- Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/605#discussion_r82495596 --- Diff: distribution/src/resources/drill-config.sh --- @@ -392,5 +392,7 @@ export DRILL_HOME export DRILL_CONF_DIR export DRILL_LOG_DIR export CP -export JAVA_HOME +# DRILL-4870: Don't export JAVA_HOME. Java can find it just fine from the java +# command. If we attempt to work out out, we do so incorrectly for the Mac. --- End diff -- Yikes! Fixed the typo. Changed the reference to JAVA_HOME to a reference relative to java, which we must already know. > drill-config.sh sets JAVA_HOME incorrectly for the Mac > ------------------------------------------------------ > > Key: DRILL-4870 > URL: https://issues.apache.org/jira/browse/DRILL-4870 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.8.0 > Environment: MacOS with unset JAVA_HOME > Reporter: Paul Rogers > Assignee: Chunhui Shi > Priority: Minor > Fix For: 1.9.0 > > > It turns out that drill-config.sh is both improperly and unnecessarily setting the JAVA_HOME envrironment variable. That setting should be removed. > In the Drill 1.7 version, drill-config.sh checks if the JAVA_HOME environment variable is set. If not, it sets JAVA_HOME based on its guess as to the proper value. > In the 1.7 version, the veriable was set, but not exported, so the variable was never actually used. > The recent script fixes for 1.8 "fixed" the export problem. The fix works fine on Linux. But, the Java install on the Mac has a different structure than that on Linux. The value that drill-config.sh guesses is fine for Linux, wrong for the Mac. > When we export the (wrong) JAVA_HOME, Mac users who have not set JAVA_HOME will get the following error when using a Drill script: > ./drill-embedded > Unable to locate an executable at "/System/Library/Frameworks/JavaVM.framework/Versions/A/bin/java" > Mac users who do set JAVA_HOME will not encounter the problem (because drill-config.sh does not change an existing value.) > It seems likely that someone in the past ecountered the same problem and removed the export of DRILL_HOME as an attempt to fix the problem. > As it turns out, Java does know how to set JAVA_HOME properly if not set. So, setting JAVA_HOME is unnecessary. > The proper fix is to remove JAVA_HOME setting from drill-config.sh. > The workaround for any 1.8 user who encounters the problem is to edit their $DRILL_HOME/bin/drill-config.sh file and delete this line near the end of the file: > export JAVA_HOME -- This message was sent by Atlassian JIRA (v6.3.4#6332)