This is an automated email from the ASF dual-hosted git repository.

benjobs pushed a commit to branch dev-2.1.2
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git


The following commit(s) were added to refs/heads/dev-2.1.2 by this push:
     new 526774a97 [Improve] setclasspath improvement
526774a97 is described below

commit 526774a97662975192d382ff390015e17f118198
Author: benjobs <[email protected]>
AuthorDate: Fri Dec 1 01:17:55 2023 +0800

    [Improve] setclasspath improvement
---
 .../src/main/assembly/bin/setclasspath.sh                 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/streampark-console/streampark-console-service/src/main/assembly/bin/setclasspath.sh
 
b/streampark-console/streampark-console-service/src/main/assembly/bin/setclasspath.sh
index 175c7b6bc..c99c30c1c 100755
--- 
a/streampark-console/streampark-console-service/src/main/assembly/bin/setclasspath.sh
+++ 
b/streampark-console/streampark-console-service/src/main/assembly/bin/setclasspath.sh
@@ -55,7 +55,22 @@ if [ -z "$JAVA_HOME" ] && [ -z "$JRE_HOME" ]; then
 fi
 
 if [ -z "$JRE_HOME" ]; then
+  # JAVA_HOME_MUST be set
+  if [ ! -x "$JAVA_HOME"/bin/java ]; then
+    echo "The JAVA_HOME environment variable is not defined correctly"
+    echo "JAVA_HOME=$JAVA_HOME"
+    echo "This environment variable is needed to run this program"
+    echo "NB: JAVA_HOME should point to a JDK not a JRE"
+    exit 1
+  fi
   JRE_HOME="$JAVA_HOME"
+else
+  if [ ! -x "$JRE_HOME"/bin/java ]; then
+    echo "The JRE_HOME environment variable is not defined correctly"
+    echo "JRE_HOME=$JRE_HOME"
+    echo "This environment variable is needed to run this program"
+    exit 1
+  fi
 fi
 
 # Set standard commands for invoking Java, if not already set.

Reply via email to