You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2018/12/14 01:43:04 UTC

[GitHub] shaofengshi closed pull request #385: set JAVA_HOME before server start or stop

shaofengshi closed pull request #385: set JAVA_HOME before server start or stop
URL: https://github.com/apache/kylin/pull/385
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index b04707815c..13eafe6492 100755
--- a/build/bin/kylin.sh
+++ b/build/bin/kylin.sh
@@ -30,6 +30,8 @@ fi
 mkdir -p ${KYLIN_HOME}/logs
 mkdir -p ${KYLIN_HOME}/ext
 
+source ${dir}/set-java-home.sh
+
 function retrieveDependency() {
     #retrive $hive_dependency and $hbase_dependency
     source ${dir}/find-hive-dependency.sh
diff --git a/build/bin/set-java-home.sh b/build/bin/set-java-home.sh
new file mode 100644
index 0000000000..6a50525e71
--- /dev/null
+++ b/build/bin/set-java-home.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${JAVA_HOME}" ]
+then
+    JAVA_HOME=$(readlink -nf $(which java) | xargs dirname | xargs dirname | xargs dirname)
+    if [ ! -e "$JAVA_HOME" ]  # nonexistent home
+    then
+        JAVA_HOME=""
+    fi
+    export JAVA_HOME=$JAVA_HOME
+fi
+
+# Validate kylin JDK version
+JAVA_VERSION=$(hbase -version 2>&1  | awk -F '"' '/version/ {print $2}' | awk -F "." '{print $1$2}')
+if [ "$JAVA_VERSION" -lt 18 ]
+then
+    quit "Kylin requires JDK 1.8+, please install or upgrade your JDK"
+fi


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services