Skip to content

Commit

Permalink
optimize: support resolving JAVA_HOME from symbolic links when `which…
Browse files Browse the repository at this point in the history
… java` is used
  • Loading branch information
llkkk authored Dec 23, 2024
1 parent 762303b commit 935a443
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions distribution/bin/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ if [ -z "$JAVA_HOME" ]; then
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
if [ -L "$JAVA_PATH" ]; then
JAVA_PATH=$(readlink -f "$JAVA_PATH")
fi
JAVA_HOME=$(dirname "$JAVA_PATH")/..
export JAVA_HOME=$(cd "$JAVA_HOME" && pwd)
fi
Expand Down

0 comments on commit 935a443

Please sign in to comment.