0

I deleted default application and controller and made new ones to rename them. But I got error

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

Process finished with exit code 1

The code is very simple.

package com.example.demo5;

import javafx.application.Application;
import javafx.stage.Stage;

public class Main extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage stage) {
        stage.show();
    }
}

I set up javafx library and vmoptions, and checked that it ran with default application and controller.

Must I use the default files?

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • 1
    Does this answer your question? [IntelliJ can't recognize JavaFX 11 with OpenJDK 11](https://stackoverflow.com/questions/52467561/intellij-cant-recognize-javafx-11-with-openjdk-11) – kleopatra Jan 27 '22 at 23:53

1 Answers1

2

Use the Idea new JavaFX project wizard to generate your project, Application and Controller classes and sample FXML.

If you want to rename the generated code, don't delete and recreate the generated Application, Controller, and sample FXML, rename them through a refactoring.

When you do this, the IDE will automatically reconfigure everything in the project to use the new names.

jewelsea
  • 150,031
  • 14
  • 366
  • 406