You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pd...@apache.org on 2021/01/13 13:56:04 UTC
[zeppelin] branch branch-0.9 updated: [ZEPPELIN-5195] check
JAVA_HOME in check_java_version
This is an automated email from the ASF dual-hosted git repository.
pdallig pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/branch-0.9 by this push:
new 8b5b26d [ZEPPELIN-5195] check JAVA_HOME in check_java_version
8b5b26d is described below
commit 8b5b26dbd8d5efe65d30eb4f149d91aa6d35680c
Author: yejingchen <ye...@gmail.com>
AuthorDate: Mon Jan 11 19:19:07 2021 +0800
[ZEPPELIN-5195] check JAVA_HOME in check_java_version
### What is this PR for?
Make check_java_version in bin/common.sh check JAVA_HOME if set
### What type of PR is it?
Bug Fix
### Todos
None
### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-5195
### How should this be tested?
* Strongly recommended: add automated unit tests for any new or changed behavior
* Outline any manual steps to test the PR here.
### Screenshots (if appropriate)
### Questions:
* Does the licenses files need update?
No
* Is there breaking changes for older versions?
No
* Does this needs documentation?
No
Author: yejingchen <ye...@gmail.com>
Closes #4018 from yejingchen/patch-1 and squashes the following commits:
c42a70184 [yejingchen] common.sh: use if statement instead of '&&' for java check
064364125 [yejingchen] [ZEPPELIN-5195] check JAVA_HOME in check_java_version
(cherry picked from commit 7ff0db9a060e435c4ba4be0462c4937c2fdc8984)
Signed-off-by: Philipp Dallig <ph...@gmail.com>
---
bin/common.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/bin/common.sh b/bin/common.sh
index 6b8a4bc..da93eb3 100644
--- a/bin/common.sh
+++ b/bin/common.sh
@@ -66,6 +66,9 @@ fi
ZEPPELIN_CLASSPATH+=":${ZEPPELIN_CONF_DIR}"
function check_java_version() {
+ if [[ -n "${JAVA_HOME+x}" ]]; then
+ JAVA="$JAVA_HOME/bin/java"
+ fi
java_ver_output=$("${JAVA:-java}" -version 2>&1)
jvmver=$(echo "$java_ver_output" | grep '[openjdk|java] version' | awk -F'"' 'NR==1 {print $2}' | cut -d\- -f1)
JVM_VERSION=$(echo "$jvmver"|sed -e 's|^\([0-9][0-9]*\)\..*$|\1|')