diff --git a/launcher/dependency-reduced-pom.xml b/launcher/dependency-reduced-pom.xml index 15c2fc1..140cb06 100644 --- a/launcher/dependency-reduced-pom.xml +++ b/launcher/dependency-reduced-pom.xml @@ -48,6 +48,12 @@ **/*-linux.jar + + *:javafx-* + + * + + / @@ -132,6 +138,9 @@ + + + diff --git a/launcher/pom.xml b/launcher/pom.xml index 3b8de61..3c0090c 100644 --- a/launcher/pom.xml +++ b/launcher/pom.xml @@ -17,6 +17,9 @@ 2026 ZernMC Launcher - just a minimalistic launcher by SashegDev me.sashegdev.zernmc.launcher.Main + win + win + false @@ -82,6 +85,20 @@ 21.0.2 win + + org.openjfx + javafx-controls + 21.0.2 + linux + runtime + + + org.openjfx + javafx-web + 21.0.2 + linux + runtime + org.junit.jupiter junit-jupiter @@ -178,11 +195,14 @@ - + com.akathist.maven.plugins.launch4j launch4j-maven-plugin 2.5.0 + + ${skip.launch4j} + l4j @@ -238,13 +258,15 @@ - + - + + *${javafx.classifier}.jar + - @@ -279,5 +301,35 @@ http://87.120.187.36:1582 + + + + win + + + windows + + + + win + win + false + + + + + + linux + + + unix + + + + linux + linux + true + + \ No newline at end of file diff --git a/launcher/src/main/java/me/sashegdev/zernmc/launcher/Main.java b/launcher/src/main/java/me/sashegdev/zernmc/launcher/Main.java index f50ddab..33d8deb 100644 --- a/launcher/src/main/java/me/sashegdev/zernmc/launcher/Main.java +++ b/launcher/src/main/java/me/sashegdev/zernmc/launcher/Main.java @@ -186,12 +186,20 @@ public class Main { try { String javaPath = System.getProperty("java.home") + "/bin/java"; String jarPath = getCurrentJarPath().toAbsolutePath().toString(); + String launcherDir = jarPath.substring(0, jarPath.lastIndexOf(java.io.File.separator)); + String javafxPath = launcherDir + java.io.File.separator + "lib-javafx"; System.out.println(ZAnsi.brightGreen("Перезапуск лаунчера с новой версией...")); - new ProcessBuilder(javaPath, "-jar", jarPath) - .inheritIO() - .start(); + ProcessBuilder pb = new ProcessBuilder( + javaPath, + "--module-path=" + javafxPath, + "--add-modules=javafx.controls,javafx.web", + "--add-reads=javafx.graphics=ALL-UNNAMED", + "-jar", jarPath + ); + pb.inheritIO(); + pb.start(); System.exit(0); } catch (Exception e) {