Skip to content

Commit

Permalink
fix get main_class. #2990
Browse files Browse the repository at this point in the history
  • Loading branch information
hengyunabc committed Feb 14, 2025
1 parent 3307687 commit 3144514
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions common/src/main/java/com/taobao/arthas/common/PidUtils.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.taobao.arthas.common;

import java.lang.management.ManagementFactory;
import java.util.Map;

/**
*
Expand Down Expand Up @@ -29,10 +28,7 @@ public class PidUtils {
}

try {
for (final Map.Entry<String, String> entry : System.getenv().entrySet()) {
if (entry.getKey().startsWith("JAVA_MAIN_CLASS")) // like JAVA_MAIN_CLASS_13328
MAIN_CLASS = entry.getValue();
}
MAIN_CLASS = System.getProperty("sun.java.command", "");
} catch (Throwable e) {
// ignore
}
Expand Down

0 comments on commit 3144514

Please sign in to comment.