title: Compile JavaFX Code using ANT
body: <p>I have following installed on my system - </p>
  
  <pre><code> Java version "1.7.0_09"
   JavaFX 2.0 SDK 
   NetBeans 7.2.1
  </code></pre>
  
  <p>When I am trying to compile the code using ANT it showing me error message - </p>
  
  <pre><code>Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found. 
  </code></pre>
  
  <p>Build.XML contains </p>
  
  <pre><code>&lt;project name="XYZ"  default="XYZ" basedir="XYZ" xmlns:fx="javafx:com.sun.javafx.tools.ant"&gt;
      &lt;description&gt;
          simple example build file
      &lt;/description&gt;
  
    &lt;!-- set global properties for this build --&gt;
      &lt;property name="srcXYZGenerator" location="src/XYZGenerator"/&gt;
  
  
      &lt;property name="classpath" location="lib/XYZLib.jar;lib/ABC.jar;lib/IJK.jar;"/&gt;
  
  
      &lt;target name="init"&gt;
          &lt;!-- Create the time stamp --&gt;
          &lt;tstamp/&gt;
          &lt;!-- Create the build directory structure used by compile --&gt;
          &lt;mkdir dir="${buildXYZ}"/&gt;  
  
      &lt;/target&gt; 
  
      &lt;target name="XYZ" depends="init"&gt;
      &lt;!-- Compile the java code from ${src} into ${build} --&gt;
      &lt;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"/&gt;
      &lt;javac classpath="${classpath}" srcdir="${srcXYZ}" destdir="${buildXYZ}"/&gt;
      &lt;/target&gt;
  
  
  &lt;/project&gt;  
  </code></pre>
  
  <p>Other Compilation Errors:</p>
  
  <pre><code>[javac] C:\Users\JavaUser4\Desktop\XYX2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:19: error: package javafx.scene does not exist
  [javac] import javafx.scene.Node;
  [javac]                    ^
  [javac] C:\Users\JavaUser4\Desktop\XYZ2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:20: error: package javafx.scene.control does not exist
  [javac] import javafx.scene.control.Button;
  [javac]                            ^
  [javac] C:\Users\JavaUser4\Desktop\XYZ2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:21: error: package javafx.scene.control does not exist
  [javac] import javafx.scene.control.Label;
  [javac]                            ^
  [javac] C:\Users\JavaUser4\Desktop\XYZ2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:22: error: package javafx.scene.input does not exist
  [javac] import javafx.scene.input.MouseEvent;
  </code></pre>