Benjy Strauss
Benjy Strauss

Reputation: 99

JavaFX runtime components are missing (Eclipse)

When running a JavaFX project in Eclipse, I get the following error:

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

I've tried adding "--module-path jars/javafx/lib --add-modules javafx.control, javafx.fxml" to the jvm arguments, but this then gives the error:

Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.control not found

The javafx library classes are in the eclipse build path and clearly show up in my "Referenced Libraries". There are no compile time errors, just the runtime error.

Note that the .jar files themselves (javafx.control.jar, et cetera) are in "jars/javafx/lib", so I'm not sure why the modules can't be found.

Does anyone know what's going on? I've seen similar questions with other IDEs, but nothing that has worked.

My java runtime is

openjdk version "11.0.7" 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

Upvotes: 1

Views: 6383

Answers (1)

Benjy Strauss
Benjy Strauss

Reputation: 99

Found the error: I should have been using "jars/javafx/lib/" instead of "jars/javafx/lib". It's running now, the last "/" makes the difference. Thanks to all those who offered help in the comments.

Upvotes: 2

Related Questions