mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
[FEATURE] Включение аргументов JVM специально для Java 9+
This commit is contained in:
parent
0e2c19f79c
commit
c7ae361234
1 changed files with 8 additions and 0 deletions
|
@ -18,7 +18,9 @@
|
|||
public class ClientLauncherWrapper {
|
||||
public static final String MAGIC_ARG = "-Djdk.attach.allowAttachSelf";
|
||||
public static final String WAIT_PROCESS_PROPERTY = "launcher.waitProcess";
|
||||
public static final String NO_JAVA9_CHECK_PROPERTY = "launcher.noJava9Check";
|
||||
public static boolean waitProcess = Boolean.getBoolean(WAIT_PROCESS_PROPERTY);
|
||||
public static boolean noJava9check = Boolean.getBoolean(NO_JAVA9_CHECK_PROPERTY);
|
||||
|
||||
public static void main(String[] arguments) throws IOException, InterruptedException {
|
||||
LogHelper.printVersion("Launcher");
|
||||
|
@ -57,6 +59,12 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
|||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.CUSTOMDIR_PROPERTY);
|
||||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
||||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_OPTDIR_PROPERTY);
|
||||
if (!noJava9check && !System.getProperty("java.version").startsWith("1.8"))
|
||||
{
|
||||
LogHelper.debug("Found Java 9+ ( %s )", System.getProperty("java.version"));
|
||||
Collections.addAll(args, "--add-modules");
|
||||
Collections.addAll(args, "javafx.base,javafx.fxml,javafx.controls,jdk.unsupported");
|
||||
}
|
||||
Collections.addAll(args, MAGIC_ARG);
|
||||
Collections.addAll(args, "-XX:+DisableAttachMechanism");
|
||||
Collections.addAll(args, "-javaagent:".concat(pathLauncher).concat("=pr"));
|
||||
|
|
Loading…
Reference in a new issue