简体   繁体   中英

JavaFX application does not run under IntelliJ Idea

I am using the unchanged sample application that IntelliJ IDEA 2016.3.3 generate. When I try to run it it says " Process finished with exit code -1073740791 (0xC0000409) " However, when I run the exact same source code in Eclipse everything goes fine. PS: I am using the Default Settings in IntelliJ ID.

Main.java:

package sample;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception{
        Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
        primaryStage.setTitle("Hello World");
        primaryStage.setScene(new Scene(root, 300, 275));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Sample.fxml

<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<GridPane fx:controller="sample.Controller"
      xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10">
</GridPane>

Controller.java

package sample;

public class Controller {
}

UPDATE : I solved this Problem by deactivating my nVidia Card on my Laptop.

This error is usually linked with nVidia graphics drivers every now and then. I can confirm that it is due to 1/24/2017 update. Roll back to December 2016 update for now until they fix this issue.

我遇到了同样的问题,从Nvidia安装376.33驱动程序,它应该可以再次工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM