cannot get my environment for the new JavaFX 11 right on Eclipse
package application;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
public class Main extends Application {
@Override
public void start(Stage primaryStage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
Scene scene = new Scene(new StackPane(l), 640, 480);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch();
}
}
错误: 找不到或无法加载主类 application.Main 原因: java.lang.NoClassDefFoundError: javafx/application/Application
that's the console result,the code won't give error,the problem is that it couldn't run.
Comments
Post a Comment