21

I encountered the following RuntimeException when starting an application which uses JavaFX 11+:

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/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
    at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    at java.base/java.lang.Thread.run(Thread.java:835)
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
    at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: No toolkit found
    at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
    ... 5 more
3
  • 1
    glad your found a solution :) you might consider to post it as an answer (to your own question) - doing so makes it more prominently recognizable to others Commented Apr 8, 2019 at 10:16
  • For those who are using Java 8. Try Installing Zulu version of JDK-FX (from azul.com/downloads/?package=jdk-fx) fixed it for me. Replace your old JDK config with this one I mean. It works for me. The rest answers are useless. Commented Jun 6, 2023 at 7:39
  • Comprehensive setup instructions for JavaFX are at openjfx. Follow those or your IDE vendor's instructions, e.g. for JavaFX in Idea. Commented Jan 16, 2024 at 19:14

7 Answers 7

10

Download the JavaFX Windows SDK using the link below

https://gluonhq.com/products/javafx/

and use the options below in VM argument's when running FX Application

-p $ModuleFileDir$/lib/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.base,javafx.fxml,javafx.graphics,javafx.media,javafx.web --add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED --add-exports javafx.base/com.sun.javafx.event=ALL-UNNAMED

Note: Don't change anything in the downloaded folder: use as it is. The DLL files are important; if the DLL files are missing then the above error pops up.

Sign up to request clarification or add additional context in comments.

1 Comment

Your note was key. I didn't use anything other than the --add-modules though. No opens or export.
6

I faced the same issue. It turns out I had downloaded the aarch64 version instead of x64. https://gluonhq.com/products/javafx/

1 Comment

I had the same problem, by mistake I downloaded x86 archive instead of x64 for my Windows 10. So now, it works ok
4

After downloading JavaFX 11+, extract the file, and when the file is extracted, switch to IntelliJ IDEA. Then follow the steps below in IntelliJ IDEA.

  1. File
  2. Project Structure
  3. Global Libraries
  4. Press the "+" sign and then Java
  5. Go to the JavaFX 11+ folder you have just downloaded. Go into the Folder and now go into "lib" and select all of these files in the Folder except "src.zip", and press "OK" in the bottom right corner and save it as "javafx12".
  6. Now you move the mouse pointer under the "+" and press right click on the Librarie that you named as "javafx12", now a small window opens with different options but you press the mouse pointer on "Add to Modules" after you did that you move the mouse pointer to the "src" Folder and right-click with the mouse. Now open a wide window with various options but you choose the "New" option, now has opened a wide window with many different options but you choose again "module-info.java" and now you copy this text:

    module YOUR-PROJECT-NAME {
    
        requires javafx.graphics;
        requires javafx.controls;
        requires javafx.media;
        requires javafx.base;
        requires javafx.web;
        requires javafx.swing;
        requires javafx.fxml;
    
        opens application;
    }
    

This resolves the problem.

Comments

4

The solution that worked for me was to add the \bin directory of the JavaFX SDK to java.library.path. This has the same effect as copying the files from the bin folder to the path of JAVA_HOME but it keeps the change project-specific.

File -> Project Properties -> Run

-Djava.library.path="C:\path\to\javafx-sdk-11.0.2\bin"

Comments

1

I strongly recommend using maven for creating the JavaFX program. The approach is illustrated in the Intellij workshop on JavaFX. link However; there is a simple solution to this problem. you have to extract all content of the JavaFX SDK; then add libraries without removing or changing other subfolders. if you just copy the lib subfolder, it will not address folders in the bin subfolder

Comments

1

I've had this problem and have been doing intensive research for three days. What I did is build a custom JRE with jlink and I was getting the same error. To solve this go to your javafx-sdk download then open the bin and copy these 3 files prism_d3d.dll, glass.dll, javafx_font.dll then paste them in your custom JRE bin folder. If you try running the program again it should work. Here are some useful links:

  1. Creating a JRE with jlink here minute 5:28
  2. Creating a JAR with no build tools using vscode here
  3. If you want to create a self-contained app with jpackage jpackage --type exe --input where/your/jar/is --main-jar nameOfTheJar.jar --main-class mainClassName --name appName --runtime-image path/to/custom/jre --app-version 1.0.0 --icon icon/path --dest destination/of/output

Some times when you are running jdeps to find the dependencies you will get an error about release, just add --multi-release yourDependencieVersion

1 Comment

I really put in 3 files and it worked out! Do you know why? Is it a matter of jlink and javafx?
-1

You don't have to include everything in the module-info, only the pieces that you use. The minimum seems to be base, controls, and graphics. (My code uses those and fxml.) For example, if you're not using swing or media, javafx.swing and javafx.media may be omitted. The rendering toolkit, the part that wasn't found, is in the Windows-specific binary. It's in the javafx-sdk/bin directory. That directory has to be part of java.library.path. If you're using modules, javafx-sdk/lib may be part of the module-path. (Of course, the particular version is part of the javafx-sdk directory name.)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.