I am running a simple javafx program on eclipse IDE. However, whenever I run my code, a launch error is displayed. There is no description of the error by the IDE and I am not sure what is causing that.
Also, I have e(fx)clipse and Gluon plugin installed. My code is very simple and I don't think that it is causing this error, however, I have attached it below for reference.
package application;
import Menus.MainMenu;
import javafx.application.Application;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
try {
MainMenu mainMenu = new MainMenu();
primaryStage = mainMenu.getMainStage();
primaryStage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
Code for MainMenu is
package Menus;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class MainMenu {
private static final int HEIGHT = 600;
private static final int WIDTH = 800;
private AnchorPane mainPane;
private Scene mainScene;
private Stage mainStage;
public MainMenu() {
mainPane = new AnchorPane();
mainScene = new Scene(mainPane);
mainStage = new Stage();
mainStage.setScene(mainScene);
mainStage.setFullScreen(true);
}
public Stage getMainStage() {
return mainStage;
}
}