From c7ae36123414688ea5f0415e277db9f67c5ac08b Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 18 Sep 2019 03:32:57 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=92=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B0=D1=80=D0=B3=D1=83=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=BE=D0=B2=20JVM=20=D1=81=D0=BF=D0=B5=D1=86=D0=B8?= =?UTF-8?q?=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=20=D0=B4=D0=BB=D1=8F=20Java=209+?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pro/gravit/launcher/ClientLauncherWrapper.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java b/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java index d3d431a9..eba6a111 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java +++ b/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java @@ -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"));