OS Version: CentOS 7 64bit
JDK Version: 1.8.0_181
When I execute the command :
I have configured the $JAVA_HOME environment variable in the .bash_profile file, and the input java-version is also output normally. When I execute ./as.sh, I am prompted to set the variable?
Hi, could you paste the debugging output of executing as.sh?
bash -x as.sh
I guess the reason is the JVM version /usr/local/jdk1.8.0_181 is not recognizable to Arthas.
+ ARTHAS_HOME=/root/.arthas
+ ARTHAS_LIB_DIR=/root/.arthas/lib
+ TMP_DIR=/tmp
+ ARTHAS_VERSION=
+ ARTHAS_SCRIPT_VERSION=3.0.2
+ ARTHAS_REMOTE_VERSION_URL=http://arthas.io/api/arthas/newestVersion.do
+ ARTHAS_REMOTE_DOWNLOAD_URL=http://arthas.io/mdtool
+ SO_TIMEOUT=5
+ DEFAULT_TARGET_IP=127.0.0.1
+ DEFAULT_TELNET_PORT=3658
+ DEFAULT_HTTP_PORT=8563
+ JVM_OPTS=
+ BATCH_MODE=false
+ ATTACH_ONLY=false
+ BATCH_SCRIPT=
+ ARTHAS_OPTS=-Djava.awt.headless=true
+ main
+ echo 'Arthas script version: 3.0.2'
Arthas script version: 3.0.2
+ echo 'Try out Arthas online: /arthas/web-console'
Try out Arthas online: /arthas/web-console
+ check_permission
+ '[' '!' -w /root ']'
+ reset_for_env
+ mkdir -p /root/.arthas/lib
+ '[' -z ']'
+ JAVA_HOME=/opt/taobao/java
+ '[' '!' -d /opt/taobao/java ']'
+ JAVA_HOME_CANDIDATES=($(ps aux | grep java | grep -v 'grep java' | awk '{print $11}' | sed -n 's/\/bin\/java$//p'))
++ ps aux
++ grep java
++ grep -v 'grep java'
++ awk '{print $11}'
++ sed -n 's/\/bin\/java$//p'
++ /opt/taobao/java/bin/java -version
++ awk -F '"' '$2>"1.5"{print $2}'
+ local JAVA_VERSION_STR=
+ [[ ! -x /opt/taobao/java ]]
+ exit_on_err 1 'illegal ENV, please set $JAVA_HOME to JDK6+'
+ [[ ! -z illegal ENV, please set $JAVA_HOME to JDK6+ ]]
+ echo 'illegal ENV, please set $JAVA_HOME to JDK6+'
illegal ENV, please set $JAVA_HOME to JDK6+
+ exit 1
It looks like your JAVA_HOME is not correctly configured.
Please run export JAVA_HOME=/usr/local/jdk1.8.0_181 before starting Arthas.
export VERY IMPORTANT
Thank You!
Because of a problem with my .bash_profile configuration
Old configuration:
JAVA_HOME=/usr/local/jdk1.8.0_181
PATH=$JAVA_HOME/bin:$PATH
export PATH
New configuration:
JAVA_HOME=/usr/local/jdk1.8.0_181
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
VERY IMPORTANT
Thankyou
It looks like your
JAVA_HOMEis not correctly configured.Please run
export JAVA_HOME=/usr/local/jdk1.8.0_181before starting Arthas.
Thankyou! My problem is solved