繁体   English   中英

JavaFX应用程序无法在IntelliJ Idea下运行

[英]JavaFX application does not run under IntelliJ Idea

我正在使用IntelliJ IDEA 2016.3.3生成的不变的示例应用程序。 当我尝试运行它时,它说“ 进程以退出代码-1073740791(0xC0000409)完成 ”,但是,当我在Eclipse中运行完全相同的源代码时,一切正常。 PS:我正在使用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 {
}

更新 :我通过停用笔记本电脑上的nVidia卡解决了此问题。

此错误通常不时与nVidia图形驱动程序链接。 我可以确认这是由于2017年1月24日更新。 现在回滚到2016年12月更新,直到他们解决此问题。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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