We had similar problems and in the end it was better to switch to maven. Just create your Netbeans Platform Application using “Java with Maven” > “NetBeans Application” and add JavaFX as a maven dependency to the module that requires it.
For example, add the following to the <dependencies> inside the pom.xml of the NB Module: <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-controls</artifactId> <version>17.0.1</version> </dependency> <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-fxml</artifactId> <version>17.0.1</version> </dependency> <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-swing</artifactId> <version>17.0.1</version> </dependency> HTH From: 王东华 <wdh_...@163.com> Sent: giovedì 13 gennaio 2022 09:26 To: users@netbeans.apache.org Subject: Netbeans IDE 12.6/JavaFX 17/Java 11 Dear, Our development environment: Netbeans IDE 12.6, JavaFX 17, Java 11 I have create a Netbeans Platform Application and want to use JavaFX, I have add JavaFX jar into the wrapped jars, and there are no compile error for JavaFX in Netbeans IDE, However, when I run the application, IDE will show following exception: java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:276) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163) at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:225) [catch] at java.base/java.lang.Thread.run(Thread.java:829) And I don't know how to add -module-path and --add-modules for Netbeans Platform Application