diff --git a/boot/src/main/java/com/taobao/arthas/boot/ProcessUtils.java b/boot/src/main/java/com/taobao/arthas/boot/ProcessUtils.java index 4707984e..da17a646 100644 --- a/boot/src/main/java/com/taobao/arthas/boot/ProcessUtils.java +++ b/boot/src/main/java/com/taobao/arthas/boot/ProcessUtils.java @@ -150,7 +150,10 @@ public class ProcessUtils { String javaHome = System.getProperty("java.home"); if (JavaVersionUtils.isLessThanJava9()) { - File toolsJar = new File(javaHome, "../lib/tools.jar"); + File toolsJar = new File(javaHome, "lib/tools.jar"); + if (!toolsJar.exists()) { + toolsJar = new File(javaHome, "../lib/tools.jar"); + } if (!toolsJar.exists()) { // maybe jre toolsJar = new File(javaHome, "../../lib/tools.jar"); @@ -311,7 +314,10 @@ public class ProcessUtils { } String javaHome = findJavaHome(); - File toolsJar = new File(javaHome, "../lib/tools.jar"); + File toolsJar = new File(javaHome, "lib/tools.jar"); + if (!toolsJar.exists()) { + toolsJar = new File(javaHome, "../lib/tools.jar"); + } if (!toolsJar.exists()) { // maybe jre toolsJar = new File(javaHome, "../../lib/tools.jar");