print ARTHAS_LIB_DIR and JAVA_HOME. #2289

pull/2293/head
hengyunabc 2 years ago
parent 9ca6782acd
commit 24171d4f8d

@ -85,6 +85,8 @@ ARTHAS_HOME=
# define arthas's lib # define arthas's lib
if [ -z "${ARTHAS_LIB_DIR}" ]; then if [ -z "${ARTHAS_LIB_DIR}" ]; then
ARTHAS_LIB_DIR=${HOME}/.arthas/lib ARTHAS_LIB_DIR=${HOME}/.arthas/lib
else
echo "[INFO] ARTHAS_LIB_DIR: ${ARTHAS_LIB_DIR}"
fi fi
# target process id to attach # target process id to attach

@ -135,6 +135,7 @@ public class Bootstrap {
String arthasLibDirEnv = System.getenv("ARTHAS_LIB_DIR"); String arthasLibDirEnv = System.getenv("ARTHAS_LIB_DIR");
if (arthasLibDirEnv != null) { if (arthasLibDirEnv != null) {
ARTHAS_LIB_DIR = new File(arthasLibDirEnv); ARTHAS_LIB_DIR = new File(arthasLibDirEnv);
AnsiLog.info("ARTHAS_LIB_DIR: " + arthasLibDirEnv);
} else { } else {
ARTHAS_LIB_DIR = new File( ARTHAS_LIB_DIR = new File(
System.getProperty("user.home") + File.separator + ".arthas" + File.separator + "lib"); 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, public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException,
ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException { IllegalArgumentException, InvocationTargetException {
String javaHome = System.getProperty("java.home");
if (javaHome != null) {
AnsiLog.info("JAVA_HOME: " + javaHome);
}
Package bootstrapPackage = Bootstrap.class.getPackage(); Package bootstrapPackage = Bootstrap.class.getPackage();
if (bootstrapPackage != null) { if (bootstrapPackage != null) {
String arthasBootVersion = bootstrapPackage.getImplementationVersion(); String arthasBootVersion = bootstrapPackage.getImplementationVersion();

Loading…
Cancel
Save