0

I'm trying to get Spring Boot working with Java FX according to this tutorial. Specifically I cloned and tried to run this project from the tutorial, which is supposed to be set up correctly.

When I try to run the project in Eclipse with Run as / Spring Boot App, I get the following error:

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

I'm running JDK 11 and I tried adding the javafx jars to the build path according to the tutorial. Am I missing something?

Jardo
  • 1,939
  • 2
  • 25
  • 45
  • If you are having problem getting something to run, start with something simpler, like HelloWorld using JavaFX (no Spring, no IDE) as demoed in [this guide](https://openjfx.io/openjfx-docs/). Once you have that working, then move on to trying to [get JavaFX working in Eclipse](https://openjfx.io/openjfx-docs/#install-javafx). Only once you have that working, try to add in Spring. – jewelsea Oct 29 '19 at 17:37
  • See also a related question on: [Adding Spring Dependency Injection in JavaFX](https://stackoverflow.com/questions/57887944/adding-dependency-injection-in-javafx-jpa-repo-service/57896435#57896435) – jewelsea Oct 29 '19 at 17:44

1 Answers1

1

In addition to adding the JavaFX libraries to build path, you also have to edit the run configuration and add --add-modules javafx.controls,javafx.fxml to the VM arguments.

Saw that when reading the official guide again based on @jewelsea's comment.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
Jardo
  • 1,939
  • 2
  • 25
  • 45