From 24171d4f8de79ba985a1a39cf6095c7635b670f5 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 21 Sep 2022 19:33:07 +0800 Subject: [PATCH] print ARTHAS_LIB_DIR and JAVA_HOME. #2289 --- bin/as.sh | 2 ++ boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/bin/as.sh b/bin/as.sh index 4e696b369..282d69493 100755 --- a/bin/as.sh +++ b/bin/as.sh @@ -85,6 +85,8 @@ ARTHAS_HOME= # define arthas's lib if [ -z "${ARTHAS_LIB_DIR}" ]; then ARTHAS_LIB_DIR=${HOME}/.arthas/lib +else + echo "[INFO] ARTHAS_LIB_DIR: ${ARTHAS_LIB_DIR}" fi # target process id to attach diff --git a/boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java b/boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java index 5f91cfb7e..1c8763ba8 100644 --- a/boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java +++ b/boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java @@ -135,6 +135,7 @@ public class Bootstrap { String arthasLibDirEnv = System.getenv("ARTHAS_LIB_DIR"); if (arthasLibDirEnv != null) { ARTHAS_LIB_DIR = new File(arthasLibDirEnv); + AnsiLog.info("ARTHAS_LIB_DIR: " + arthasLibDirEnv); } else { ARTHAS_LIB_DIR = new File( System.getProperty("user.home") + File.separator + ".arthas" + File.separator + "lib"); @@ -311,6 +312,10 @@ public class Bootstrap { public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + String javaHome = System.getProperty("java.home"); + if (javaHome != null) { + AnsiLog.info("JAVA_HOME: " + javaHome); + } Package bootstrapPackage = Bootstrap.class.getPackage(); if (bootstrapPackage != null) { String arthasBootVersion = bootstrapPackage.getImplementationVersion();