mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-12 05:16:13 -04:00
修复使用 Java 19+ 启动游戏时控制台乱码的问题 (#2846)
This commit is contained in:
parent
9f6124d617
commit
02065094ca
@ -150,8 +150,14 @@ public class DefaultLauncher extends Launcher {
|
||||
LOG.log(Level.WARNING, "Bad file encoding", ex);
|
||||
}
|
||||
}
|
||||
res.addDefault("-Dsun.stdout.encoding=", encoding.name());
|
||||
res.addDefault("-Dsun.stderr.encoding=", encoding.name());
|
||||
|
||||
if (options.getJava().getParsedVersion() < 19) {
|
||||
res.addDefault("-Dsun.stdout.encoding=", encoding.name());
|
||||
res.addDefault("-Dsun.stderr.encoding=", encoding.name());
|
||||
} else {
|
||||
res.addDefault("-Dstdout.encoding=", encoding.name());
|
||||
res.addDefault("-Dstderr.encoding=", encoding.name());
|
||||
}
|
||||
|
||||
// Fix RCE vulnerability of log4j2
|
||||
res.addDefault("-Djava.rmi.server.useCodebaseOnly=", "true");
|
||||
|
Loading…
x
Reference in New Issue
Block a user