You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ -f"$jstack_path" ] || die "$jstack_path is NOT found!"
318
-
[ -x"$jstack_path" ] || die "$jstack_path is NOT executable!"
322
+
# 1. check jstack_path set by -s option
323
+
[ -f"$jstack_path" ] || die "$jstack_path (set by -s option) is NOT found!"
324
+
[ -x"$jstack_path" ] || die "$jstack_path (set by -s option) is NOT executable!"
325
+
elif [ -n"$JAVA_HOME" ];then
326
+
# 2. search jstack under JAVA_HOME
327
+
if [ -f"$JAVA_HOME/bin/jstack" ];then
328
+
[ -x"$JAVA_HOME/bin/jstack" ] || die "found \$JAVA_HOME/bin/jstack($JAVA_HOME/bin/jstack) is NOT executable!${nl}Use -s option set jstack path manually."
329
+
jstack_path="$JAVA_HOME/bin/jstack"
330
+
elif [ -f"$JAVA_HOME/../bin/jstack" ];then
331
+
[ -x"$JAVA_HOME/../bin/jstack" ] || die "found \$JAVA_HOME/../bin/jstack($JAVA_HOME/../bin/jstack) is NOT executable!${nl}Use -s option set jstack path manually."
332
+
jstack_path="$JAVA_HOME/../bin/jstack"
333
+
fi
319
334
elifcommand -v jstack &>/dev/null;then
335
+
# 3. search jstack under PATH
320
336
jstack_path="$(command -v jstack)"
337
+
[ -x"$jstack_path" ] || die "found $jstack_path from PATH is NOT executable!${nl}Use -s option set jstack path manually."
321
338
else
322
-
[ -n"$JAVA_HOME" ] || die "jstack not found on PATH and No JAVA_HOME setting! Use -s option set jstack path manually."
323
-
[ -f"$JAVA_HOME/bin/jstack" ] || die "jstack not found on PATH and \$JAVA_HOME/bin/jstack($JAVA_HOME/bin/jstack) file does NOT exists! Use -s option set jstack path manually."
324
-
[ -x"$JAVA_HOME/bin/jstack" ] || die "jstack not found on PATH and \$JAVA_HOME/bin/jstack($JAVA_HOME/bin/jstack) is NOT executable! Use -s option set jstack path manually."
325
-
jstack_path="$JAVA_HOME/bin/jstack"
339
+
die "jstack NOT found by JAVA_HOME(${JAVA_HOME:-not set}) setting and PATH!${nl}Use -s option set jstack path manually."
0 commit comments