diff --git a/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java b/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java index aaeba1ec..a8083d7d 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java +++ b/Launcher/src/main/java/pro/gravit/launcher/ClientLauncherWrapper.java @@ -63,8 +63,6 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep 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"); Path jvmDir = Paths.get(System.getProperty("java.home")); String pathToFx = System.getenv("PATH_TO_FX"); Path fxPath = pathToFx == null ? null : Paths.get(pathToFx); @@ -79,6 +77,8 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep { Collections.addAll(args, "--module-path"); Collections.addAll(args, modulePath); + Collections.addAll(args, "--add-modules"); + Collections.addAll(args, "javafx.base,javafx.fxml,javafx.controls,jdk.unsupported"); } } Collections.addAll(args, MAGIC_ARG); diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index a1556111..94c46024 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -27,8 +27,16 @@ import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; +import javax.swing.*; + public class LauncherEngine { + public static void noJavaFxAlert() { + String message = String.format("Библиотеки JavaFX не найдены. У вас %s(x%d) ОС %s(x%d). Java %s. Установите Java с поддержкой JavaFX, например OracleJRE 8 x%d с официального сайта.\nЕсли вы не можете решить проблему самостоятельно обратитесь к администрации своего проекта", JVMHelper.RUNTIME_MXBEAN.getVmName(), + JVMHelper.JVM_BITS, JVMHelper.OS_TYPE.name, JVMHelper.OS_BITS, JVMHelper.RUNTIME_MXBEAN.getSpecVersion(), JVMHelper.OS_BITS); + JOptionPane.showMessageDialog(null, message, "GravitLauncher", JOptionPane.ERROR_MESSAGE); + } + public static void main(String... args) throws Throwable { JVMHelper.checkStackTrace(LauncherEngine.class); JVMHelper.verifySystemProperties(Launcher.class, true); diff --git a/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java b/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java index f9ceebbd..34f40bd1 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java +++ b/Launcher/src/main/java/pro/gravit/launcher/gui/JSRuntimeProvider.java @@ -140,6 +140,7 @@ public static void addLauncherClassBindings(Map bindings) { bindings.put("JSApplicationClass", JSApplication.class); } catch (ClassNotFoundException ignored) { LogHelper.warning("JavaFX API isn't available"); + LauncherEngine.noJavaFxAlert(); } }