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!"
254
-
[ -x"$jstack_path" ] || die "$jstack_path is NOT executalbe!"
259
+
# 1. check jstack_path set by -s option
260
+
[ -f"$jstack_path" ] || die "$jstack_path (set by -s option) is NOT found!"
261
+
[ -x"$jstack_path" ] || die "$jstack_path (set by -s option) is NOT executable!"
262
+
elif [ -n"$JAVA_HOME" ];then
263
+
# 2. check jstack under JAVA_HOME
264
+
if [ -f"$JAVA_HOME/bin/jstack" ];then
265
+
[ -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."
266
+
jstack_path="$JAVA_HOME/bin/jstack"
267
+
elif [ -f"$JAVA_HOME/../bin/jstack" ];then
268
+
[ -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."
269
+
jstack_path="$JAVA_HOME/../bin/jstack"
270
+
fi
255
271
elif which jstack &> /dev/null;then
272
+
# 3. check jstack under PATH
256
273
jstack_path="`which jstack`"
257
-
else
258
-
[ -n"$JAVA_HOME" ] || die "jstack not found on PATH and No JAVA_HOME setting! Use -s option set jstack path manually."
259
-
[ -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."
260
-
[ -x"$JAVA_HOME/bin/jstack" ] || die "jstack not found on PATH and \$JAVA_HOME/bin/jstack($JAVA_HOME/bin/jstack) is NOT executalbe! Use -s option set jstack path manually."
261
-
jstack_path="$JAVA_HOME/bin/jstack"
262
274
fi
263
275
276
+
if [ -n"$jstack_path" ];then
277
+
die "No JAVA_HOME setting, and jstack NOT found on PATH!${nl}Use -s option set jstack path manually."
0 commit comments