将javaFX(.jar)文件导入Netbeans Maven项目

将javaFX(.jar)文件导入Netbeans Maven项目,java,maven,javafx,netbeans,Java,Maven,Javafx,Netbeans,我正在尝试将javafx(.jar)文件导入到maven项目中。我已经用Netbeans(Java with Ant->Java Application)做了一个项目,希望在Netbeans(Java with Maven->Java Application)中使用相同的代码。使用Ant,我可以轻松地导入和使用(.jar)文件,但这似乎是Maven的一个阻塞功能 有什么解决办法吗 我在网上查阅了好几篇文章和指南,但都没有找到 注意:在maven中实现.jar文件已经解决。但代码不起作用 当前错误

我正在尝试将javafx(.jar)文件导入到maven项目中。我已经用Netbeans(Java with Ant->Java Application)做了一个项目,希望在Netbeans(Java with Maven->Java Application)中使用相同的代码。使用Ant,我可以轻松地导入和使用(.jar)文件,但这似乎是Maven的一个阻塞功能

有什么解决办法吗

我在网上查阅了好几篇文章和指南,但都没有找到

注意:在maven中实现.jar文件已经解决。但代码不起作用

当前错误:“运行应用程序com.mycompany.ep_game_ref.game命令执行失败时出现异常。”

package com.mycompany.ep\u game\u ref;
导入javafx.application.application;
导入javafx.collections.FXCollections;
导入javafx.collections.ObservableList;
导入javafx.scene.image.image;
导入javafx.stage.stage;
公共类游戏扩展应用
{
公共静态字符串[]args;
公共静态阶段初级阶段;
公共静态ObservableList items=FXCollections.observableArrayList();
公共静态MainCentral StartName=新的MainCentral();
公共静态房间.Introduction intro=新房间.Introduction();
公共静态设置。难度设置=新设置。难度();
公共静态播放器=新播放器();
@凌驾
公众假期开始(阶段)
{
this.primarystage=阶段;
this.primarystage.setScene(new Scenes.Welcome().setWelcomeScene());
this.primarystage.getIcons().add(新图像(“images/aq_logo.png”);
this.primarystage.setResizeable(false);
this.primarystage.show();
}
公共静态void main(字符串[]args){
Application.launch();
}
}

您可以以不同的方式使用JavaFX:
文件>新项目>Maven>JavaFX应用程序。

谢谢,这很有效。代码无法启动tho,甚至认为它可以编译项目。@DEV您能描述一下启动代码的问题吗?当前错误是:“运行应用程序com.mycompany.ep_game_ref.game命令执行失败时出现异常。”
package com.mycompany.ep_game_ref;

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.image.Image;
import javafx.stage.Stage;


public class Game extends Application 
{
    public static String[] args;
    public static Stage primarystage;
    public static ObservableList<Items.Item> items = FXCollections.observableArrayList();
    public static MainCentral startGame = new MainCentral();
    public static Room.Introduction intro = new Room.Introduction();
    public static Settings.Difficulty SETTINGS = new Settings.Difficulty();
    public static Player player = new Player(); 

    @Override
    public void start(Stage stage) 
    {
        this.primarystage = stage;
        this.primarystage.setScene(new Scenes.Welcome().setWelcomeScene());
        this.primarystage.getIcons().add(new Image("images/aq_logo.png"));
        this.primarystage.setResizable(false);
        this.primarystage.show();
    }

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

}