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

smolnar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new e24b71de6 KNOX-3153: Fix Java command invocations in knoxcli.sh (#1048)
e24b71de6 is described below

commit e24b71de69548c9f44bae8102c99b71486284ff8
Author: bonampak <14160522+bonam...@users.noreply.github.com>
AuthorDate: Fri May 23 09:26:16 2025 +0200

    KNOX-3153: Fix Java command invocations in knoxcli.sh (#1048)
---
 gateway-release/home/bin/knoxcli.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gateway-release/home/bin/knoxcli.sh 
b/gateway-release/home/bin/knoxcli.sh
index 3477e70a4..a1569d75b 100755
--- a/gateway-release/home/bin/knoxcli.sh
+++ b/gateway-release/home/bin/knoxcli.sh
@@ -63,7 +63,7 @@ function buildAppJavaOpts {
     fi
 
     # Add properties to enable Knox to run on JDK 17
-    JAVA_VERSION=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}')
+    JAVA_VERSION=$("$JAVA" -version 2>&1 | awk -F '"' '/version/ {print $2}')
     CHECK_VERSION_17="17"
     if [[ "$JAVA_VERSION" == *"$CHECK_VERSION_17"* ]]; then
         echo "Java version is $CHECK_VERSION_17. Adding properties to enable 
Knox to run on JDK 17"
@@ -77,7 +77,7 @@ function main {
    setVerbose "$@"
    checkJava
    buildAppJavaOpts
-   $JAVA "${APP_JAVA_OPTS[@]}" -jar "$APP_JAR" "$@" || exit 1
+   "$JAVA" "${APP_JAVA_OPTS[@]}" -jar "$APP_JAR" "$@" || exit 1
    return 0
 }
 

Reply via email to