mirror of
https://gitee.com/arthas/arthas.git
synced 2024-12-02 04:08:34 +08:00
improve find tools.jar logic. fix #383
This commit is contained in:
parent
2b41b241be
commit
b6ae49acd2
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user