2

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

LOOK HERE: project structure photo

enter image description here

I have downloaded the javafx extentions for the project as well as the jar file and attached it, the program knows javafx is there since the code errors went away. However, it then said there were no docs and no it says there's no JavaFx runtime components. I have been hiting error after error trying to get javafx to just run a hello world program in eclipse.

Nitin Bisht
  • 5,053
  • 4
  • 14
  • 26
Kevin
  • 19
  • 6
  • In Java 8, a subclass of javafx.application.Application could act as a main class. That is no longer the case. You must create a different class, and define a `public static main` method in it which invokes [Application.launch](https://openjfx.io/javadoc/13/javafx.graphics/javafx/application/Application.html#launch%28java.lang.Class,java.lang.String...%29). – VGR Mar 03 '20 at 18:42
  • https://openjfx.io/openjfx-docs/ – SedJ601 Mar 03 '20 at 20:24
  • @VGR Only if using JavaFX from the classpath. If `javafx.graphics` is on the modulepath then a subclass of `Application` can still be used as the main class (without main method)β€”at least for OpenJDK and at least up to version 13.0.2. I believe this could change in the future, however. – Slaw Mar 04 '20 at 00:15

2 Answers2

3

JavaFX was removed from Java 11.

It's no longer shipped with the JDK, you need to install it separately (it's now a distinct product called OpenJFX).

jwenting
  • 5,505
  • 2
  • 25
  • 30
2

JavaFX is no longer provided in the builds after Java 10; however commercial support for JavaFX in JDK 8 (LTS) will continue through at least 2022.

You can now use OpenJFX Project, which is the open source home of JavaFX development. It's sponsored by the Swing Group.

Giorgi Tsiklauri
  • 9,715
  • 8
  • 45
  • 66