mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] noJavaFXAlert из 5.1.0
This commit is contained in:
parent
29fffae33b
commit
6b7f0d9aa3
3 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -140,6 +140,7 @@ public static void addLauncherClassBindings(Map<String, Object> bindings) {
|
|||
bindings.put("JSApplicationClass", JSApplication.class);
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
LogHelper.warning("JavaFX API isn't available");
|
||||
LauncherEngine.noJavaFxAlert();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue