user11119570
user11119570

Reputation:

Importing javaFX (.jar) files into a Netbeans Maven Project

I am trying to import javafx (.jar) files into a maven project. I have made a project with Netbeans (Java with Ant -> Java Application) and want to use the same code in Netbeans (Java with Maven -> Java Application). With Ant, I can easily import and use the (.jar) files, but this seems to be a blocked functionality with Maven.

Any solution to this?

I have looked up on several posts and guides online with no luck.

NOTE: Implementing .jar files within maven have been solved. The code does not work though.

Current Error: "Exception running application com.mycompany.ep_game_ref.Game Command execution failed."

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();
    }

}

Upvotes: 1

Views: 457

Answers (1)

Gale
Gale

Reputation: 215

You can use JavaFX in a different way: File>New Project>Maven>JavaFX Application.

Upvotes: 0

Related Questions