mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
arthas-boot support unset JAVA_TOOL_OPTIONS. #2166
This commit is contained in:
@@ -319,6 +319,15 @@ public class Bootstrap {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
String javaToolOptions = System.getenv("JAVA_TOOL_OPTIONS");
|
||||
if (javaToolOptions != null && !javaToolOptions.trim().isEmpty()) {
|
||||
AnsiLog.info("JAVA_TOOL_OPTIONS: " + javaToolOptions);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
|
||||
CLI cli = CLIConfigurator.define(Bootstrap.class);
|
||||
|
||||
@@ -266,6 +266,8 @@ public class ProcessUtils {
|
||||
// -agent "${arthas_lib_dir}/arthas-agent.jar"
|
||||
|
||||
ProcessBuilder pb = new ProcessBuilder(command);
|
||||
// https://github.com/alibaba/arthas/issues/2166
|
||||
pb.environment().put("JAVA_TOOL_OPTIONS", "");
|
||||
try {
|
||||
final Process proc = pb.start();
|
||||
Thread redirectStdout = new Thread(new Runnable() {
|
||||
|
||||
Reference in New Issue
Block a user