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 8984801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:11:40+00:00 2026-06-15T21:11:40+00:00

I have successfully complied the JavaFX code using Build Script with the previous help

  • 0

I have successfully complied the JavaFX code using Build Script with the previous help. Now I can not able to create JAR file uisng ANT for my application. I am adding sample script in build.xml. My requirement is to create a simple JAR file of my JavaFx XYZ application.

<project name="XYZ" basedir=".">

<property name="WorkingFolder" location="XYZSourceData"/>
<property name="ClassPath" location="C:\Program Files\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_09\lib\ant-javafx.jar;"/>

<target name="init">
    <echo message="Java installation directory: ${java.home}"/>
    <!-- Create the time stamp -->
    <tstamp/>

    <delete dir="${WorkingFolder}/build"/>
    <delete dir="${dist}"/>

    <mkdir dir="${WorkingFolder}/CustomJars"/>
</target>



    <target name="Compilingxyz" depends="init">
        <mkdir dir="${WorkingFolder}/build"/>
        <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"      
            uri="javafx:com.sun.javafx.tools.ant" classpath=".;C:\Program Files\Oracle\JavaFX 2.2 Runtime\lib\jfxrt.jar"/>
        <javac classpath="${ClassPath};${WorkingFolder}/CustomJars/*.jar;" srcdir="${WorkingFolder}/src/com/xyz" destdir="${WorkingFolder}/build"/>
</target>     

<target name="CreatingxyzJars" depends="Compilingxyz" description="generate the distribution" >
    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"      
            uri="javafx:com.sun.javafx.tools.ant" classpath="C:\Program Files\Java\jdk1.7.0_09\lib\ant-javafx.jar"/>

    <fx:jar destfile="${WorkingFolder}/CustomJars/XYZ.jar">
            <fx:application name="XYZ"
                mainClass="com.xyz.main.XYZEntryFX"/>
        <fx:resources>
                <fx:fileset dir="${WorkingFolder}/build" includes="${WorkingFolder}/libs/*.jar"/>
        </fx:resources>
        <fileset dir="${WorkingFolder}/resources"/>
     </fx:jar> 

</target>        

I am getting following error –

    BUILD FAILED
C:\Users\JavaUser4\Desktop\2012.12FX\build.xml:83: The prefix "fx" for element "
fx:jar" is not bound.

Total time: 0 seconds

What is the missing part? I have Java Desktop application. How can I create a ANT JAR for Java Fx Application. Please Help.

I am taking reference of following example –

Example

  • 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-15T21:11:41+00:00Added an answer on June 15, 2026 at 9:11 pm

    You’re missing the fx: namespace declaration in your project. Rather than

    <project name="XYZ" basedir=".">
    

    you need something like:

    <project name="XYZ" basedir="."
         xmlns:fx="javafx:com.sun.javafx.tools.ant">
    

    (This is from the documentation you linked to, prior page, §12.3 Using JavaFX Ant Tasks.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully compiled my code, but it says this: Note: You can also
I can successfully compiled and run the Hello World code. Now I want to
I have successfully compiled lua in my mac. It works. It runs. Now, I
I have successfully compiled the FFMPEG library to android using NDK. I want to
I'm trying to create a NuGet package from a .csproj. I have successfully compiled
I have my program written in C++ and it is can be successfully compiled
Have successfully gotten the csrf middleware working in express as per previous SO questions.
I have successfully compiled pjsip and the Siphon project ( http://code.google.com/p/siphon/ ) and it
I have successfully compiled PHP 5.4.9 on Cygwin, but now I am unable to
I have successfully compiled node.js using cygwin on windows. The problem is that my

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.