You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/12/14 01:43:07 UTC
[kylin] branch master updated: set JAVA_HOME before server start or
stop (#385)
This is an automated email from the ASF dual-hosted git repository.
shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push:
new ab51ea9 set JAVA_HOME before server start or stop (#385)
ab51ea9 is described below
commit ab51ea9aad035d08450da2abdccca2441c37092e
Author: shopee-jin <40...@users.noreply.github.com>
AuthorDate: Fri Dec 14 09:43:02 2018 +0800
set JAVA_HOME before server start or stop (#385)
* set JAVA_HOME before start or stop
---
build/bin/kylin.sh | 2 ++
build/bin/set-java-home.sh | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index b047078..13eafe6 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 0000000..6a50525
--- /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