Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8814819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:13:27+00:00 2026-06-14T04:13:27+00:00

I am new to JavaFX. I have created a Hello World project using maven.

  • 0

I am new to JavaFX. I have created a Hello World project using maven. It works fine when I run it in Eclipse.

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

@Override
public void start(Stage primaryStage) throws Exception {
    primaryStage.setTitle("Hello World!");
    Button btn = new Button();
    btn.setText("Say 'Hello World'");
    btn.setOnAction(new EventHandler<ActionEvent>() {
        public void handle(ActionEvent event) {
            System.out.println("Hello World!");
        }
    });
    StackPane root = new StackPane();
    root.getChildren().add(btn);
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}

hello_world

I found the deployment tutorial, but when my program comes with maven, I have no idea how to build it.

When I try to build the application using build.fxbuild, I got this error.

Buildfile: C:\test\project\workspace\javafx-helloworld\build\build.xml

setup-staging-area:
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\externalLibs
        [copy] Copying 1 file to C:\test\project\workspace\javafx-helloworld\build\externalLibs
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\project
        [copy] Copying 1 file to C:\test\project\workspace\javafx-helloworld\build\project
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\projectRefs

do-compile:
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\build\src
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\build\libs
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\build\classes
        [copy] Copying 1 file to C:\test\project\workspace\javafx-helloworld\build\build\libs
        [copy] Copying 1 file to C:\test\project\workspace\javafx-helloworld\build\build\src
       [javac] Compiling 1 source file to C:\test\project\workspace\javafx-helloworld\build\build\classes

init-fx-tasks:
     [taskdef] Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.

do-deploy:
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\dist
       [mkdir] Created dir: C:\test\project\workspace\javafx-helloworld\build\dist\libs
        [copy] Copying 1 file to C:\test\project\workspace\javafx-helloworld\build\dist\libs

**BUILD FAILED
C:\test\project\workspace\javafx-helloworld\build\build.xml:93: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:resources
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.
No types or tasks have been defined in this namespace yet**
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:13:28+00:00Added an answer on June 14, 2026 at 4:13 am

    There is now a maven plugin for JavaFX:

    https://github.com/zonski/javafx-maven-plugin

    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>package</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <mainClass>[put your application main class here]</mainClass>
            <bundleType>ALL</bundleType>
        </configuration>
    </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello guys i have been using JavaFx scene builder to build a gui that
I have a hello-world style java ee application using maven3 glassfish3 and javaee6. I
I have a simple RESTful web service that print Hello World ! I'm using
I have created a EJB2.0 using Eclipse 3.7 IDE, and deployed it in JBoss
I've got a small hello world app I've created, using JFrame / JPanel ,
I am new to JavaFX 2.0 and to do practice I have followed the
I have created a ejb2 application in eclipse 3.7, with jboss 5.0 application server.
I am new to Eclipse. Currently developing a sample web application using primefaces 3.1
i have created a JFrame in netbeans. But when i run the program, the
i am very new to j2me. i have created a sample program, but i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.