4

My application uses Java Fx Web to display html pages, the problem is that this error appears only when I run the .jar directly because when I run it from my ide (eclipse) it runs without problems. Does anyone have any idea what this is about? I am using AdoptOpenJdk11. I have also tested it on my colleague's computer and it also doesn't work.

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 com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
        at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
        at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:241)
        at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:257)
        at com.rubicon.game.client.window.main.menu.GameMenuPanel.<init>(GameMenuPanel.java:62)
        at com.rubicon.game.client.network.states.LobbyConnectionState.enable(LobbyConnectionState.java:12)
        at com.rubicon.game.client.ClientApplication.loadComponents(ClientApplication.java:115)
        at com.rubicon.game.client.ClientApplication.lambda$initializate$0(ClientApplication.java:98)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        at com.rubicon.game.client.network.NetworkConnection.lambda$login$0(NetworkConnection.java:124)
        at com.rubicon.game.core.network.packets.PacketResponse.lambda$whenComplete$0(PacketResponse.java:30)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        at com.rubicon.game.core.network.packets.PacketResponse.complete(PacketResponse.java:24)
        at com.rubicon.game.core.network.packets.request.PacketRequestLogin.onClientReceive(PacketRequestLogin.java:43)
        at com.rubicon.game.client.network.callback.PacketCallbackRequester.onReceive(PacketCallbackRequester.java:33)
        at com.rubicon.game.client.network.NetworkConnection.execute(NetworkConnection.java:94)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
        ... 1 more

Width -Dprism.verbose=true:

Prism pipeline init order: d3d sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.d3d.D3DPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.d3d.D3DPipeline
java.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
        at java.base/java.lang.Thread.run(Thread.java:834)
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
GraphicsPipeline.createPipeline failed for com.sun.prism.sw.SWPipeline
java.lang.ClassNotFoundException: com.sun.prism.sw.SWPipeline
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
        at java.base/java.lang.Thread.run(Thread.java:834)
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 com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
        at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:261)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
        at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:241)
        at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:257)
        at com.rubicon.game.client.window.main.menu.GameMenuPanel.<init>(GameMenuPanel.java:62)
        at com.rubicon.game.client.network.states.LobbyConnectionState.enable(LobbyConnectionState.java:12)
        at com.rubicon.game.client.ClientApplication.loadComponents(ClientApplication.java:115)
        at com.rubicon.game.client.ClientApplication.lambda$initializate$0(ClientApplication.java:98)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        at com.rubicon.game.client.network.NetworkConnection.lambda$login$0(NetworkConnection.java:124)
        at com.rubicon.game.core.network.packets.PacketResponse.lambda$whenComplete$0(PacketResponse.java:30)
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        at com.rubicon.game.core.network.packets.PacketResponse.complete(PacketResponse.java:24)
        at com.rubicon.game.core.network.packets.request.PacketRequestLogin.onClientReceive(PacketRequestLogin.java:43)
        at com.rubicon.game.client.network.callback.PacketCallbackRequester.onReceive(PacketCallbackRequester.java:33)
        at com.rubicon.game.client.network.NetworkConnection.execute(NetworkConnection.java:94)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
        ... 1 more

And in the line 62 im only creating a JFXPanel Object.... JFXPanel Object Creation Image

Maven Dependencies? (Maybe need more? Maybe need another version?)

<dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-web</artifactId>
        <version>15</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-swing</artifactId>
        <version>15</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics</artifactId>
        <version>15</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>15</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-base</artifactId>
        <version>15</version>
    </dependency>

Any additional necessary information just ask!

Solved! (MinimizeZar problem in maven)

Diogo Vaz
  • 41
  • 1
  • 1
  • 4
  • 1
    How are you building the JAR? – Slaw Jan 15 '21 at 13:43
  • With Maven! Pom.xml: https://pastebin.com/GVz845ph @Slaw – Diogo Vaz Jan 15 '21 at 13:47
  • It's for a different error, but perhaps [this answer](https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing/52654791?) can help you. You may also want to check out [this other answer](https://stackoverflow.com/a/53453519/6395627). – Slaw Jan 15 '21 at 13:57
  • The problem is that I am not using the "Application" class because my app does other things as well... :/ Something also appears when it is being compiled, can something like "Minimizing Jar" be for this reason? @Slaw – Diogo Vaz Jan 15 '21 at 14:07
  • In my experience, the error you're getting means JavaFX is present but the native code is missing. So if you're stripping things from the final JAR then that can indeed be the cause of the problem. Both `javafx.graphics` and `javafx.web` have corresponding native code. Make sure they're in your final JAR. – Slaw Jan 15 '21 at 14:10
  • I'm also not sure how "Minimizing Jar" works, but make sure it isn't removing essential Java code as well. For instance, it looks like JavaFX uses reflection to load the needed pipeline and if the plugin doesn't recognize that it could be erroneously removing code it incorrectly thinks is not being used. – Slaw Jan 15 '21 at 14:15
  • Aaaaaaaa thats it man!! Minimizing Jar things! – Diogo Vaz Jan 15 '21 at 14:17
  • This answer worked for me: https://stackoverflow.com/a/68228380/336557 – Mahm00d Feb 10 '23 at 09:07

1 Answers1

4

If someone comes here to get help about this error, add this line to your pom

<classifier>mac</classifier>

depending on your target platform : mac , linux, win

So the block becomes like

    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics</artifactId>
        <version>17</version>
        <classifier>mac</classifier>
    </dependency>
yerlilbilgin
  • 3,041
  • 2
  • 26
  • 21
ahmed
  • 161
  • 1
  • 6
  • Anyone know how this would work for Gradle? – Christopher Allen May 30 '22 at 06:43
  • @ChristopherAllen yes, add it to the end of your implementation line: "org.openjfx:javafx-graphics:17:mac" – Josh Larson Jul 05 '22 at 06:59
  • Adding a classifier is unnecessary for most builds and the `mac` classifier is incorrect for M processor (non-intel) macs. Also, non-intel Macs require a more recent JavaFX version to work correctly, e.g. 19+. – jewelsea Jan 18 '23 at 14:25