From fc78aa3348bc505c43e8e2795255d11dd58f334c Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 23 Feb 2023 20:38:17 +0800 Subject: [PATCH] [ISSUE #6026] Fix the problem that the custom JAVA_HOME environment variable does not take effect --- distribution/bin/runbroker.sh | 4 ++++ distribution/bin/runserver.sh | 4 ++++ distribution/bin/tools.sh | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/distribution/bin/runbroker.sh b/distribution/bin/runbroker.sh index da1aa9f7352..0b2a70ff664 100644 --- a/distribution/bin/runbroker.sh +++ b/distribution/bin/runbroker.sh @@ -28,6 +28,10 @@ find_java_home() { case "`uname`" in Darwin) + if [ -n "$JAVA_HOME" ]; then + JAVA_HOME=$JAVA_HOME + return + fi JAVA_HOME=$(/usr/libexec/java_home) ;; *) diff --git a/distribution/bin/runserver.sh b/distribution/bin/runserver.sh index 0f8b5b3e51b..c30e1e5736a 100644 --- a/distribution/bin/runserver.sh +++ b/distribution/bin/runserver.sh @@ -28,6 +28,10 @@ find_java_home() { case "`uname`" in Darwin) + if [ -n "$JAVA_HOME" ]; then + JAVA_HOME=$JAVA_HOME + return + fi JAVA_HOME=$(/usr/libexec/java_home) ;; *) diff --git a/distribution/bin/tools.sh b/distribution/bin/tools.sh index 17207703ab7..bd3a4dd3897 100644 --- a/distribution/bin/tools.sh +++ b/distribution/bin/tools.sh @@ -28,6 +28,10 @@ find_java_home() { case "`uname`" in Darwin) + if [ -n "$JAVA_HOME" ]; then + JAVA_HOME=$JAVA_HOME + return + fi JAVA_HOME=$(/usr/libexec/java_home) ;; *)