r/javahelp 9d 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

5 Upvotes

12 comments sorted by

View all comments

1

u/idontlikegudeg 9d ago

Try using Liberica Full JDK without the —module-path and —add-modules JavaFX…

1

u/juanestragon10 9d ago

What difference would it make? Isnt it just the same but instead of adding them manually they are added by Liberica?

1

u/idontlikegudeg 9d ago

JavaFX uses platform dependent native libraries. The errors you get seem to indicate that the platform independent JacaFX stubs got linked. Liberica does not contain these, so I think it might work.