Skip to content

Commit

Permalink
optimize: support get java cmd from which java (#11720)
Browse files Browse the repository at this point in the history
  • Loading branch information
slievrly authored Feb 20, 2024
1 parent e6eb636 commit 3c278ed
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion distribution/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ if [ -z "$JAVA_HOME" ]; then
fi
fi
if [ -z "$JAVA_HOME" ]; then
error_exit "Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better!"
JAVA_PATH=$(which java)
if [ -z "$JAVA_PATH" ]; then
error_exit "Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better!"
fi
JAVA_HOME=$(dirname "$JAVA_PATH")/..
export JAVA_HOME=$(cd "$JAVA_HOME" && pwd)
fi
fi

Expand Down

0 comments on commit 3c278ed

Please sign in to comment.