Eclipse does not want to run a simple JavaFX application

I have other classes called Test in other packages and one class with the same name in the default package.

When I click the Run button in Eclipse, instead of launching this class, another Test class is launched from inside the other package:

package jfx; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.shape.Circle; import javafx.stage.Stage; public class Test extends Application { public void start(Stage stage) { Circle circ = new Circle(40, 40, 30); Group root = new Group(circ); Scene scene = new Scene(root, 400, 300); stage.setTitle("My JavaFX Application"); stage.setScene(scene); stage.show(); } } 

How can i fix this?

+5
source share
1 answer

Add a main method to let Eclipse recognize the program as an executable application

 public static void main(String[] args) { Application.launch(args); } 
+5
source

All Articles