This is an automated email from the ASF dual-hosted git repository.
pdallig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git
The following commit(s) were added to refs/heads/master by this push:
new 7ff0db9 [ZEPPELIN-5195] check JAVA_HOME in check_java_version
7ff0db9 is described below
commit 7ff0db9a060e435c4ba4be0462c4937c2fdc8984
Author: yejingchen <[email protected]>
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 <[email protected]>
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
---
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|')