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

Mark Raynsford org.openjdk at
Sat Oct 13 18:29:41 UTC 2018

On 2018-10-13T19:46:34 +0200
Johan Vos <johan.vos at> wrote:
> There are some workarounds (e.g. you can have a Main class that doesn't
> extend Application that calls your Application), but the best approach is
> go modular, as explained here:

The following appears to work: Given an unsurprising subclass of

public final class ExampleApplication extends Application
  private static final Logger LOG =

  public ExampleApplication()


  public void start(
    final Stage stage)

    final Button button = new Button();

    final BorderPane pane = new BorderPane();

    final Scene scene = new Scene(pane, 640.0, 480.0);

Then a main method that passes a class reference rather than allowing
the launcher to reflectively find the application:

public final class Main
  private Main()


  public static void main(
    final String[] args)
     * Non-modular applications must specify the application class explicitly rather
     * than allowing the launcher to use reflection to try to instantiate and start
     * an application.

    Application.launch(ExampleApplication.class, args);

The application starts up and runs without issue.

Mark Raynsford |

More information about the openjfx-dev mailing list