arthas-boot support unset JAVA_TOOL_OPTIONS. #2166

pull/2286/head
hengyunabc 2 years ago
parent 298e3db559
commit 60b3080c86

@ -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() {

Loading…
Cancel
Save