title: Cannot build JavaFX application using Ant
body: <p>I need to create build file for ant to build my JavaFX project, I have searched a lot, but nothing helped me. It still show errors but compiles. When I tries to run jar file - exceptions. I have tried different paths, but still nothing.<br>
  Here is my build.xml.     </p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;project name="JDBC Ant Project" default="default" basedir="." xmlns:**fx="javafx:com.sun.javafx.tools.ant"**(Uri is not registered)&gt;
      &lt;property name="src.dir" location="src"/&gt;
      &lt;property name="build.dir" location="classes"/&gt;
      &lt;property name="out.dir" location="out"/&gt;
      &lt;property name="docs.dir" location="docs"/&gt;
      &lt;property name="bin.dir" location="bin"/&gt;
      &lt;property name="lib.dir" location="lib"/&gt;
      &lt;property name="jar.name" value="javafxtest.jar"/&gt;
      &lt;property name="sdk.dir" location="/usr/lib/jvm/java-8-oracle/lib"/&gt;
      &lt;target name="default" depends="clean,compile"&gt;
          &lt;path id="fxant"&gt;
              &lt;filelist&gt;
                  &lt;file name="/usr/lib/jvm/java-8-oracle/lib/ant-javafx.jar"/&gt;
                  &lt;file name="/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar"/&gt;
              &lt;/filelist&gt;
          &lt;/path&gt;
          &lt;*taskdef*(Failed to load types) resource="com/sun/javafx/tools/ant/antlib.xml"
                   uri="javafx:com.sun.javafx.tools.ant"
                   classpathref="fxant"/&gt;
  
          &lt;fx:**application** id="HelloWorldID"
                          name="JDBC Java FX"
                          mainClass="Main"/&gt;
  
          &lt;fx:resources id="appRes"&gt;
              &lt;fx:fileset dir="${out.dir}" includes="HelloWorld.jar"/&gt;
          &lt;/fx:resources&gt;
  
          &lt;fx:jar destfile="${out.dir}/${jar.name}"&gt;
              &lt;fx:application refid="HelloWorldID"/&gt;
              &lt;fx:resources refid="appRes"/&gt;
              &lt;fileset dir="${build.dir}"/&gt;
          &lt;/fx:jar&gt;
  
          &lt;fx:**deploy width**="300" **height**="250"
                     **outdir**="." **embedJNLP**="true"
                     **outfile**="helloworld"&gt;
  
              &lt;fx:**application** refId="HelloWorldID"/&gt;
  
              &lt;**fx:resources** refid="appRes"/&gt;
  
              &lt;**fx:info** title="JavaFX Hello World Application"
                       vendor="Oracle Corporation"/&gt;
  
          &lt;/fx:**deploy**&gt;
  
      &lt;/target&gt;
  
      &lt;target name="clean"&gt;
          &lt;echo&gt;Performing clean target&lt;/echo&gt;
          &lt;delete dir="${build.dir}"/&gt;
          &lt;delete dir="${docs.dir}"/&gt;
          &lt;delete dir="${out.dir}"/&gt;
      &lt;/target&gt;
  
      &lt;target name="init"&gt;
          &lt;echo&gt;Performing init target&lt;/echo&gt;
          &lt;mkdir dir="${build.dir}"/&gt;
          &lt;mkdir dir="${docs.dir}"/&gt;
          &lt;mkdir dir="${out.dir}"/&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="clean, init"&gt;
          &lt;echo&gt;Performing compiling&lt;/echo&gt;
          &lt;javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}"&gt;
              &lt;classpath refid="build.classpath"/&gt;
          &lt;/javac&gt;
  
      &lt;/target&gt;
      &lt;path id="build.classpath"&gt;
          &lt;fileset dir="${lib.dir}" casesensitive="no"&gt;
              &lt;include name="**/*.jar"/&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
      &lt;target name="javadoc" depends="compile"&gt;
          &lt;javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}"&gt;
              &lt;!-- Define which files / directory should get included, we include all --&gt;
              &lt;fileset dir="${src.dir}"&gt;
                  &lt;include name="**"/&gt;
                  &lt;exclude name="**/resources/**"/&gt;
              &lt;/fileset&gt;
          &lt;/javadoc&gt;
      &lt;/target&gt;
  
      &lt;target name="build" depends="compile"&gt;
          &lt;jar destfile="${out.dir}/${jar.name}" basedir="${build.dir}"&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Main-Class" value="Main"/&gt;
              &lt;/manifest&gt;
          &lt;/jar&gt;
      &lt;/target&gt;
  
      &lt;target name="main" depends="compile, build, javadoc"&gt;
          &lt;description&gt;Main target&lt;/description&gt;
      &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>** is fully "red" in my IDEA (Intellij IDEA.<br>
  * is underlined . </p>
  
  <p>But nevertheless it builds using ant -f build.xml. But when I tries to run jar file I am getting next exceptions. 
  Exception in Application start method</p>
  
  <pre><code>java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  .....
  .....
  Caused by: java.lang.IllegalStateException: Location is not set.
      at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2438)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2413)
      at Main.start(Unknown Source)
  </code></pre>