mirror of
https://github.com/alibaba/arthas.git
synced 2026-10-22 10:53:36 +00:00
add as.sh/arthas-boot.jar 3.0.5.2
This commit is contained in:
Binary file not shown.
@@ -8,10 +8,10 @@
|
||||
|
||||
# program : Arthas
|
||||
# author : Core Engine @ Taobao.com
|
||||
# date : 2018-12-13
|
||||
# date : 2018-12-20
|
||||
|
||||
# current arthas script version
|
||||
ARTHAS_SCRIPT_VERSION=3.0.5.1
|
||||
ARTHAS_SCRIPT_VERSION=3.0.5.2
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
@@ -246,6 +246,23 @@ reset_for_env()
|
||||
exit_on_err 1 "Can not find JAVA_HOME, please set \$JAVA_HOME bash env first."
|
||||
fi
|
||||
|
||||
# when java version less than 9, we can use tools.jar to confirm java home.
|
||||
# when java version greater than 9, there is no tools.jar.
|
||||
if [[ "$JAVA_VERSION" -lt 9 ]];then
|
||||
# possible java homes
|
||||
javaHomes=("${JAVA_HOME%%/}" "${JAVA_HOME%%/}/.." "${JAVA_HOME%%/}/../..")
|
||||
for javaHome in ${javaHomes[@]}
|
||||
do
|
||||
toolsJar="$javaHome/lib/tools.jar"
|
||||
if [ -f $toolsJar ]; then
|
||||
JAVA_HOME=$( rreadlink $javaHome )
|
||||
BOOT_CLASSPATH=-Xbootclasspath/a:$( rreadlink $toolsJar )
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ -z "${BOOT_CLASSPATH}" ] && exit_on_err 1 "tools.jar was not found, so arthas could not be launched!"
|
||||
fi
|
||||
|
||||
echo "[INFO] JAVA_HOME: ${JAVA_HOME}"
|
||||
|
||||
# maybe 1.8.0_162 , 11-ea
|
||||
@@ -268,16 +285,6 @@ reset_for_env()
|
||||
fi
|
||||
done
|
||||
|
||||
# when java version greater than 9, there is no tools.jar
|
||||
if [[ "$JAVA_VERSION" -lt 9 ]];then
|
||||
# check tools.jar exists
|
||||
if [ ! -f "${JAVA_HOME}/lib/tools.jar" ]; then
|
||||
exit_on_err 1 "${JAVA_HOME}/lib/tools.jar does not exist, arthas could not be launched!"
|
||||
else
|
||||
BOOT_CLASSPATH=-Xbootclasspath/a:${JAVA_HOME}/lib/tools.jar
|
||||
fi
|
||||
fi
|
||||
|
||||
# reset CHARSET for alibaba opts, we use GBK
|
||||
[[ -x /opt/taobao/java ]] && JVM_OPTS="-Dinput.encoding=GBK ${JVM_OPTS} "
|
||||
|
||||
@@ -422,7 +429,7 @@ WIKI:
|
||||
Here is the list of possible java process(es) to attatch:
|
||||
"
|
||||
|
||||
$(call_jps) | grep -v sun.tools.jps.Jps
|
||||
call_jps | grep -v sun.tools.jps.Jps
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user