hod
hod

Reputation: 11

Error: JavaFX runtime component is missing and needs to be used to run this application

jdk:17.0.8 Mave:3.8.8

the code is IntelliJ IDEA auto generate,use IntelliJ IDEA run is normal


public class HelloApplication extends Application {
    @Override
    public void start(Stage stage) throws IOException {
        FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
        Scene scene = new Scene(fxmlLoader.load(), 320, 240);
        stage.setTitle("Hello!");
        stage.setScene(scene);
        stage.show();
    }

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

Upvotes: 1

Views: 181

Answers (0)

Related Questions