Skip to content

Commit 3144514

Browse files
committed
fix get main_class. #2990
1 parent 3307687 commit 3144514

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

common/src/main/java/com/taobao/arthas/common/PidUtils.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.taobao.arthas.common;
22

33
import java.lang.management.ManagementFactory;
4-
import java.util.Map;
54

65
/**
76
*
@@ -29,10 +28,7 @@ public class PidUtils {
2928
}
3029

3130
try {
32-
for (final Map.Entry<String, String> entry : System.getenv().entrySet()) {
33-
if (entry.getKey().startsWith("JAVA_MAIN_CLASS")) // like JAVA_MAIN_CLASS_13328
34-
MAIN_CLASS = entry.getValue();
35-
}
31+
MAIN_CLASS = System.getProperty("sun.java.command", "");
3632
} catch (Throwable e) {
3733
// ignore
3834
}

0 commit comments

Comments
 (0)