I have other classes named 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 running this class, it runs another Test class from inside another package instead:
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?
Add a main
method to allow Eclipse recognize the program as runnable application
public static void main(String[] args) {
Application.launch(args);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With