Under Java Build Path Libraries under the properties of my project, I have my User Library called javafx12 under Modulepath.
This removed all the errors regarding import javafx not resolved.
When I try to run my project, I get
"Error: Could not find or load main class application.Main Caused by: java.lang.NoClassDefFoundError: javafx/application/Application"
How do I get rid of this error?
I am using Java SE 12 aka JDK 12.
I am using eclipse as well.
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,400,400);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
} catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
launch(args);
}
}
No errors in the class file.

