Search code examples
eclipsejavafxtimeout

JavaFX window takes a while to load and getting an error in Eclipse


When I try to run the default JavaFX code in Eclipse, it takes a while for the window to open and I get this error:

com.sun.glass.ui.mac.MacApplication lambda$waitForReactivation$6 WARNING: Timeout while waiting for app reactivation

It works fine on my Windows PC, I only get this error on my Mac.

The window didn't open at all until I unchecked the -XstartOnFirstThread argument in Run Configurations. But I'm still getting the error.

package application;
    
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;


public class Main extends Application {
    @Override
    public void start(Stage primaryStage) {
        try {
            BorderPane root = new BorderPane();
            Scene scene = new Scene(root,100,100);
            primaryStage.setScene(scene);
            primaryStage.show();
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
    
    public static void main(String[] args) {
        launch(args);
    }
}

Solution

  • It seems a bug in MacOS 14, and will be fixed in version 22. Application window not activated in macOS 14 Sonoma