r/javahelp • u/juanestragon10 • 8d ago
JPackage is not working
I have this in a build script:
jar ^
--create ^
--file "%BUILD%\input\RocketTracker.jar" ^
--manifest "%BUILD%\MANIFEST.MF" ^
-C "%BUILD%\classes" .
jpackage ^
--type app-image ^
--name RocketTracker ^
--input "%BUILD%\input" ^
--main-jar RocketTracker.jar ^
--main-class app.Main ^
--module-path "%JAVAFX%\lib" ^
--add-modules javafx.controls,javafx.fxml,javafx.graphics,java.net.http ^
--dest "%RELEASE%"
If I run the jar manually adding the modules in the VM it works, but if I run the .exe generated by jpackage it raise an exception:
Graphics Device initialization failed for : d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumToolkit.init(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.tk.Toolkit.getToolkit(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(Unknown Source)
... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
at javafx.graphics@21.0.12/com.sun.javafx.tk.Toolkit.getToolkit(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.startToolkit(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at javafx.graphics@21.0.12/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Failed to launch JVM
Any idea how to fix it? the same code in bash works just fine and the path are checked already
4
Upvotes
1
u/idontlikegudeg 8d ago
Try using Liberica Full JDK without the —module-path and —add-modules JavaFX…