0

I'm trying to run the sample JavaFX project using IntelliJ but it fails with the exception :

Error: JavaFX runtime components are missing, and are required to run this application

I have download jdk 17 and intellij 2022.3 and OpenJFX from :

And if I add a VM option :

--module-path "C:\Program Files\Java\javafx-sdk-19.0.2.1\lib" --add-modules javafx.controls,javafx.fxml

I get these errors:

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@19.0.2.1/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
    at javafx.graphics@19.0.2.1/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
    at javafx.graphics@19.0.2.1/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:268)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1082)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at javafx.graphics@19.0.2.1/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
    at javafx.graphics@19.0.2.1/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
    at java.base/java.lang.Thread.run(Thread.java:833)
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:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1082)
Caused by: java.lang.RuntimeException: No toolkit found
    at javafx.graphics@19.0.2.1/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
    at javafx.graphics@19.0.2.1/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
    ... 5 more

What should I do?

I try all the fixes on youtube but doesn't work.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • 2
    Please format the stack trace as code. – James_D Feb 09 '23 at 19:08
  • 1
    For Idea I recommend the [new JavaFX project wizard](https://stackoverflow.com/questions/74764217/error-javafx-runtime-components-are-missing-with-intellij-idea-maven-and-jdk/74764297#74764297). – jewelsea Feb 09 '23 at 19:39
  • 1
    I don't recommend following JavaFX setup tutorials on youtube. Many users complain that they follow them and are unable to get working applications. Instead, follow either your [IDE instructions](https://www.jetbrains.com/help/idea/javafx.html) or official instructions at [openjfx.io](https://openjfx.io/openjfx-docs/). – jewelsea Feb 09 '23 at 19:49
  • I [edited your question to format it](https://stackoverflow.com/revisions/75402761/2), you can review the edits to learn how to improve the quality of your posts in the future. – jewelsea Feb 09 '23 at 19:50

0 Answers0