From 1be50df531881978e57f5ed2c4df55babdb9aeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+Ciilu@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:55:16 +0800 Subject: [PATCH] update --- .../jackhuang/hmcl/game/GameDumpGenerator.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/GameDumpGenerator.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/GameDumpGenerator.java index 6bc32f20b9..e0adc6368f 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/game/GameDumpGenerator.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/game/GameDumpGenerator.java @@ -20,6 +20,7 @@ import com.sun.tools.attach.AttachNotSupportedException; import com.sun.tools.attach.VirtualMachine; +import org.jackhuang.hmcl.java.JavaInfo; import org.jackhuang.hmcl.util.logging.Logger; import org.jackhuang.hmcl.util.StringUtils; import org.jackhuang.hmcl.util.platform.OperatingSystem; @@ -128,7 +129,20 @@ public static void writeDumpHeadKeyValueTo(String key, String value, Writer writ } private static void writeDumpBodyTo(VirtualMachine vm, Writer writer) throws IOException { - execute(vm, "Thread.print -e -l", writer); + int vmVersion = -1; + + try { + if (vm.getSystemProperties().get("java.version") instanceof String javaVersion) + vmVersion = JavaInfo.parseVersion(javaVersion); + } catch (Throwable e) { + LOG.warning("Failed to get VM system properties", e); + } + + if (vmVersion >= 11) + execute(vm, "Thread.print -e -l", writer); + else + execute(vm, "Thread.print -l", writer); + } private static VirtualMachine attachVM(String lvmid, Writer writer) throws IOException, InterruptedException {