Skip to content

feat: 更新时继承所有 JVM 参数#5631

Open
CiiLu wants to merge 3 commits intoHMCL-dev:mainfrom
CiiLu:update
Open

feat: 更新时继承所有 JVM 参数#5631
CiiLu wants to merge 3 commits intoHMCL-dev:mainfrom
CiiLu:update

Conversation

@CiiLu
Copy link
Contributor

@CiiLu CiiLu commented Feb 23, 2026

#5612 #5049
目前只会继承 hmcl. 开头的系统属性,导致 -Dglass.gtk.uiScale -Dprism.forceGPU=true -XX:+UseZGC -Xmx2G 等都不会继承

commandline.add("-D" + key + "=" + entry.getValue());
}
}
commandline.addAll(ManagementFactory.getRuntimeMXBean().getInputArguments());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要假设 java.management 模块一定存在,HMCL 应当能够在不包含 java.management 模块的 JRE 上工作。

Object key = entry.getKey();
if (key instanceof String stringKey) {
if (stringKey.startsWith("hmcl.") || stringKey.startsWith("glass.")
|| stringKey.startsWith("javafx.") || stringKey.startsWith("prism.")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该这样做,这些信息属性有很多是 JavaFX 和 HMCL 自动生成的,比如 JavaFX 会自动添加 javafx.versionjavafx.runtime.version 等属性,HMCL 也会根据情况添加 prism.lcdtextprism.forceGPU 等属性,这些都不应该传递给子进程。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants