mirror of
https://github.com/alibaba/arthas.git
synced 2026-10-21 05:51:38 +00:00
improve find tools.jar logic. fix #383
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user