title: JavaFX 11 Deployment Failure: failed to create task or type javafx:com.sun.javafx.tools.ant:fileset
body: <p>I am trying to deploy my project but I keep receiving the following errors, what should I do ? Also, I have java 11 but I can only select project language levels up to 10 in IntelliJ, yet I can use &quot;var&quot; syntax and run it. IntelliJ info:</p>
  <blockquote>
  <p><strong>EDIT:</strong> Apparently intellij IDEA 1.x does not support java 11 I have downloaded the recent version and currently trying to redo the whole
  process</p>
  <p><strong>FINAL EDIT: I have solved the problem by using java 8 on intelliJ IDEA 3.x and followed this <a href="https://www.youtube.com/watch?v=zf7bFiPOKvc" rel="nofollow noreferrer">guide</a>. Thank you <a href="https://stackoverflow.com/users/9744335/hce">hce</a>!</strong></p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/bYhad.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bYhad.png" alt="idea" /></a></p>
  <blockquote>
  <p>Information:Java FX Packager: [C:/Program
  Files/Java/jdk-11.0.2\bin\java, -Dant.home=D:\Programs\IntelliJ IDEA
  2018.1.5\lib\ant, -classpath, D:\Programs\IntelliJ IDEA 2018.1.5\lib\ant/lib/ant.jar;D:\Programs\IntelliJ IDEA 2018.1.5\lib\ant/lib/ant-launcher.jar;C:/Program Files/Java/jdk-11.0.2/lib/ant-javafx.jar;C:/Program
  Files/Java/jdk-11.0.2/jre/lib/jfxrt.jar,
  org.apache.tools.ant.launch.Launcher, -f,
  C:\Users\HP.IntelliJIdea2018.1\system\compile-server\luckypick-m_8a6db982_temp_\build.xml]
  Information:Java FX Packager: Buildfile:
  C:\Users\HP.IntelliJIdea2018.1\system\compile-server\luckypick-m_8a6db982_temp_\build.xml
  Information:Java FX Packager:   [taskdef] Could not load definitions
  from resource com/sun/javafx/tools/ant/antlib.xml. It could not be
  found. Information:Java FX Packager:  Information:Java FX Packager:
  build artifact: Information:27.01.2019 15:09 - Compilation completed
  with 2 errors and 0 warnings in 8 s 226 ms Error:Java FX Packager:
  BUILD FAILED
  C:\Users\HP.IntelliJIdea2018.1\system\compile-server\luckypick-m_8a6db982_temp_\build.xml:3:
  Problem: failed to create task or type
  javafx:com.sun.javafx.tools.ant:fileset 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 Total time: 0 seconds Error:Java FX Packager:
  fx:deploy task has failed.</p>
  </blockquote>
  <p>Here is how my project directory looks and which files it has.</p>
  <p><a href="https://i.stack.imgur.com/uaCGp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uaCGp.png" alt="directory" /></a></p>
  <p>Here's luckypick.properties</p>
  <pre><code>path.variable.kotl\u0131n_bundled=D\:\\Programs\\IntelliJ IDEA 2018.1.5\\plugins\\Kotlin\\kotlinc
  path.variable.maven_repos\u0131tory=C\:\\Users\\HP\\.m2\\repository
  jdk.home.11=C\:/Program Files/Java/jdk-11.0.2
  idea.home=D\:/Programs/IntelliJ IDEA 2018.1.5
  javafx.home=C\:/Users/HP/Documents/javafx-sdk-11.0.2
  javac2.instrumentation.includeJavaRuntime=false
  </code></pre>
  <p>Here's luckypick.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project name=&quot;luckypick&quot; default=&quot;all&quot;&gt;
  
  
      &lt;property file=&quot;luckypick.properties&quot;/&gt;
      &lt;!-- Uncomment the following property if no tests compilation is needed --&gt;
      &lt;!--
      &lt;property name=&quot;skip.tests&quot; value=&quot;true&quot;/&gt;
       --&gt;
  
      &lt;!-- Compiler options --&gt;
  
      &lt;property name=&quot;compiler.debug&quot; value=&quot;on&quot;/&gt;
      &lt;property name=&quot;compiler.generate.no.warnings&quot; value=&quot;off&quot;/&gt;
      &lt;property name=&quot;compiler.args&quot; value=&quot;&quot;/&gt;
      &lt;property name=&quot;compiler.max.memory&quot; value=&quot;700m&quot;/&gt;
      &lt;patternset id=&quot;ignored.files&quot;&gt;
          &lt;exclude name=&quot;**/*.hprof/**&quot;/&gt;
          &lt;exclude name=&quot;**/*.pyc/**&quot;/&gt;
          &lt;exclude name=&quot;**/*.pyo/**&quot;/&gt;
          &lt;exclude name=&quot;**/*.rbc/**&quot;/&gt;
          &lt;exclude name=&quot;**/*.yarb/**&quot;/&gt;
          &lt;exclude name=&quot;**/*~/**&quot;/&gt;
          &lt;exclude name=&quot;**/.DS_Store/**&quot;/&gt;
          &lt;exclude name=&quot;**/.git/**&quot;/&gt;
          &lt;exclude name=&quot;**/.hg/**&quot;/&gt;
          &lt;exclude name=&quot;**/.svn/**&quot;/&gt;
          &lt;exclude name=&quot;**/CVS/**&quot;/&gt;
          &lt;exclude name=&quot;**/__pycache__/**&quot;/&gt;
          &lt;exclude name=&quot;**/_svn/**&quot;/&gt;
          &lt;exclude name=&quot;**/vssver.scc/**&quot;/&gt;
          &lt;exclude name=&quot;**/vssver2.scc/**&quot;/&gt;
      &lt;/patternset&gt;
      &lt;patternset id=&quot;library.patterns&quot;&gt;
          &lt;include name=&quot;*.egg&quot;/&gt;
          &lt;include name=&quot;*.jar&quot;/&gt;
          &lt;include name=&quot;*.ear&quot;/&gt;
          &lt;include name=&quot;*.swc&quot;/&gt;
          &lt;include name=&quot;*.war&quot;/&gt;
          &lt;include name=&quot;*.zip&quot;/&gt;
          &lt;include name=&quot;*.ane&quot;/&gt;
      &lt;/patternset&gt;
      &lt;patternset id=&quot;compiler.resources&quot;&gt;
          &lt;exclude name=&quot;**/?*.java&quot;/&gt;
          &lt;exclude name=&quot;**/?*.form&quot;/&gt;
          &lt;exclude name=&quot;**/?*.class&quot;/&gt;
          &lt;exclude name=&quot;**/?*.groovy&quot;/&gt;
          &lt;exclude name=&quot;**/?*.scala&quot;/&gt;
          &lt;exclude name=&quot;**/?*.flex&quot;/&gt;
          &lt;exclude name=&quot;**/?*.kt&quot;/&gt;
          &lt;exclude name=&quot;**/?*.clj&quot;/&gt;
      &lt;/patternset&gt;
  
      &lt;!-- JDK definitions --&gt;
  
      &lt;property name=&quot;jdk.bin.11&quot; value=&quot;${jdk.home.11}/bin&quot;/&gt;
      &lt;path id=&quot;jdk.classpath.11&quot;&gt;
          &lt;fileset dir=&quot;${jdk.home.11}&quot;&gt;
              &lt;include name=&quot;/legal/java.base&quot;/&gt;
              &lt;include name=&quot;/legal/java.compiler&quot;/&gt;
              &lt;include name=&quot;/legal/java.datatransfer&quot;/&gt;
              &lt;include name=&quot;/legal/java.desktop&quot;/&gt;
              &lt;include name=&quot;/legal/java.instrument&quot;/&gt;
              &lt;include name=&quot;/legal/java.logging&quot;/&gt;
              &lt;include name=&quot;/legal/java.management&quot;/&gt;
              &lt;include name=&quot;/legal/java.management.rmi&quot;/&gt;
              &lt;include name=&quot;/legal/java.naming&quot;/&gt;
              &lt;include name=&quot;/legal/java.net.http&quot;/&gt;
              &lt;include name=&quot;/legal/java.prefs&quot;/&gt;
              &lt;include name=&quot;/legal/java.rmi&quot;/&gt;
              &lt;include name=&quot;/legal/java.scripting&quot;/&gt;
              &lt;include name=&quot;/legal/java.se&quot;/&gt;
              &lt;include name=&quot;/legal/java.security.jgss&quot;/&gt;
              &lt;include name=&quot;/legal/java.security.sasl&quot;/&gt;
              &lt;include name=&quot;/legal/java.smartcardio&quot;/&gt;
              &lt;include name=&quot;/legal/java.sql&quot;/&gt;
              &lt;include name=&quot;/legal/java.sql.rowset&quot;/&gt;
              &lt;include name=&quot;/legal/java.transaction.xa&quot;/&gt;
              &lt;include name=&quot;/legal/java.xml&quot;/&gt;
              &lt;include name=&quot;/legal/java.xml.crypto&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.accessibility&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.aot&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.attach&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.charsets&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.compiler&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.crypto.cryptoki&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.crypto.ec&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.crypto.mscapi&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.dynalink&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.editpad&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.hotspot.agent&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.httpserver&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.ed&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.jvmstat&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.le&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.opt&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.vm.ci&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.vm.compiler&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.internal.vm.compiler.management&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jartool&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.javadoc&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jcmd&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jconsole&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jdeps&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jdi&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jdwp.agent&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jfr&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jlink&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jshell&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jsobject&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.jstatd&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.localedata&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.management&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.management.agent&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.management.jfr&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.naming.dns&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.naming.rmi&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.net&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.pack&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.rmic&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.scripting.nashorn&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.scripting.nashorn.shell&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.sctp&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.security.auth&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.security.jgss&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.unsupported&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.unsupported.desktop&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.xml.dom&quot;/&gt;
              &lt;include name=&quot;/legal/jdk.zipfs&quot;/&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
  
      &lt;property name=&quot;project.jdk.home&quot; value=&quot;${jdk.home.11}&quot;/&gt;
      &lt;property name=&quot;project.jdk.bin&quot; value=&quot;${jdk.bin.11}&quot;/&gt;
      &lt;property name=&quot;project.jdk.classpath&quot; value=&quot;jdk.classpath.11&quot;/&gt;
  
  
      &lt;!-- Project Libraries --&gt;
  
      &lt;path id=&quot;library.javafx-swt.classpath&quot;&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx-swt.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.base.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.controls.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.fxml.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.graphics.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.media.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.swing.jar&quot;/&gt;
          &lt;pathelement location=&quot;${javafx.home}/lib/javafx.web.jar&quot;/&gt;
      &lt;/path&gt;
  
  
      &lt;!-- Global Libraries --&gt;
      &lt;!-- Register Custom Compiler Taskdefs --&gt;
      &lt;property name=&quot;javac2.home&quot; value=&quot;${idea.home}/lib&quot;/&gt;
      &lt;path id=&quot;javac2.classpath&quot;&gt;
          &lt;fileset dir=&quot;${javac2.home}&quot;&gt;
              &lt;include name=&quot;javac2.jar&quot;/&gt;
              &lt;include name=&quot;jdom.jar&quot;/&gt;
              &lt;include name=&quot;asm-all*.jar&quot;/&gt;
              &lt;include name=&quot;jgoodies-forms.jar&quot;/&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
      &lt;target name=&quot;register.custom.compilers&quot;&gt;
          &lt;taskdef name=&quot;javac2&quot; classname=&quot;com.intellij.ant.Javac2&quot; classpathref=&quot;javac2.classpath&quot;/&gt;
          &lt;taskdef name=&quot;instrumentIdeaExtensions&quot; classname=&quot;com.intellij.ant.InstrumentIdeaExtensions&quot;
                   classpathref=&quot;javac2.classpath&quot;/&gt;
      &lt;/target&gt;
  
      &lt;!-- Modules --&gt;
  
  
      &lt;!-- Module LuckyPick --&gt;
  
      &lt;dirname property=&quot;module.luckypick.basedir&quot; file=&quot;${ant.file}&quot;/&gt;
  
  
      &lt;property name=&quot;module.jdk.home.luckypick&quot; value=&quot;${project.jdk.home}&quot;/&gt;
      &lt;property name=&quot;module.jdk.bin.luckypick&quot; value=&quot;${project.jdk.bin}&quot;/&gt;
      &lt;property name=&quot;module.jdk.classpath.luckypick&quot; value=&quot;${project.jdk.classpath}&quot;/&gt;
  
      &lt;property name=&quot;compiler.args.luckypick&quot; value=&quot;-encoding UTF-8 -source 10 -target 10 ${compiler.args}&quot;/&gt;
  
      &lt;property name=&quot;luckypick.output.dir&quot; value=&quot;${module.luckypick.basedir}/out/production/LuckyPick&quot;/&gt;
      &lt;property name=&quot;luckypick.testoutput.dir&quot; value=&quot;${module.luckypick.basedir}/out/test/LuckyPick&quot;/&gt;
  
      &lt;path id=&quot;luckypick.module.bootclasspath&quot;&gt;
          &lt;!-- Paths to be included in compilation bootclasspath --&gt;
      &lt;/path&gt;
  
      &lt;path id=&quot;luckypick.module.production.classpath&quot;&gt;
          &lt;path refid=&quot;${module.jdk.classpath.luckypick}&quot;/&gt;
          &lt;path refid=&quot;library.javafx-swt.classpath&quot;/&gt;
      &lt;/path&gt;
  
      &lt;path id=&quot;luckypick.runtime.production.module.classpath&quot;&gt;
          &lt;pathelement location=&quot;${luckypick.output.dir}&quot;/&gt;
          &lt;path refid=&quot;library.javafx-swt.classpath&quot;/&gt;
      &lt;/path&gt;
  
      &lt;path id=&quot;luckypick.module.classpath&quot;&gt;
          &lt;path refid=&quot;${module.jdk.classpath.luckypick}&quot;/&gt;
          &lt;pathelement location=&quot;${luckypick.output.dir}&quot;/&gt;
          &lt;path refid=&quot;library.javafx-swt.classpath&quot;/&gt;
      &lt;/path&gt;
  
      &lt;path id=&quot;luckypick.runtime.module.classpath&quot;&gt;
          &lt;pathelement location=&quot;${luckypick.testoutput.dir}&quot;/&gt;
          &lt;pathelement location=&quot;${luckypick.output.dir}&quot;/&gt;
          &lt;path refid=&quot;library.javafx-swt.classpath&quot;/&gt;
      &lt;/path&gt;
  
  
      &lt;patternset id=&quot;excluded.from.module.luckypick&quot;&gt;
          &lt;patternset refid=&quot;ignored.files&quot;/&gt;
      &lt;/patternset&gt;
  
      &lt;patternset id=&quot;excluded.from.compilation.luckypick&quot;&gt;
          &lt;patternset refid=&quot;excluded.from.module.luckypick&quot;/&gt;
      &lt;/patternset&gt;
  
      &lt;path id=&quot;luckypick.module.sourcepath&quot;&gt;
          &lt;dirset dir=&quot;${module.luckypick.basedir}&quot;&gt;
              &lt;include name=&quot;src&quot;/&gt;
              &lt;include name=&quot;res&quot;/&gt;
          &lt;/dirset&gt;
      &lt;/path&gt;
  
  
      &lt;target name=&quot;compile.module.luckypick&quot; depends=&quot;compile.module.luckypick.production,compile.module.luckypick.tests&quot;
              description=&quot;Compile module LuckyPick&quot;/&gt;
  
      &lt;target name=&quot;compile.module.luckypick.production&quot; depends=&quot;register.custom.compilers&quot;
              description=&quot;Compile module LuckyPick; production classes&quot;&gt;
          &lt;mkdir dir=&quot;${luckypick.output.dir}&quot;/&gt;
          &lt;javac2 destdir=&quot;${luckypick.output.dir}&quot; debug=&quot;${compiler.debug}&quot; nowarn=&quot;${compiler.generate.no.warnings}&quot;
                  memorymaximumsize=&quot;${compiler.max.memory}&quot; fork=&quot;true&quot; executable=&quot;${module.jdk.bin.luckypick}/javac&quot;&gt;
              &lt;compilerarg line=&quot;${compiler.args.luckypick}&quot;/&gt;
              &lt;bootclasspath refid=&quot;luckypick.module.bootclasspath&quot;/&gt;
              &lt;classpath refid=&quot;luckypick.module.production.classpath&quot;/&gt;
              &lt;src refid=&quot;luckypick.module.sourcepath&quot;/&gt;
              &lt;patternset refid=&quot;excluded.from.compilation.luckypick&quot;/&gt;
          &lt;/javac2&gt;
  
          &lt;copy todir=&quot;${luckypick.output.dir}&quot;&gt;
              &lt;fileset dir=&quot;${module.luckypick.basedir}/src&quot;&gt;
                  &lt;patternset refid=&quot;compiler.resources&quot;/&gt;
                  &lt;type type=&quot;file&quot;/&gt;
              &lt;/fileset&gt;
              &lt;fileset dir=&quot;${module.luckypick.basedir}/res&quot;&gt;
                  &lt;patternset refid=&quot;compiler.resources&quot;/&gt;
                  &lt;type type=&quot;file&quot;/&gt;
              &lt;/fileset&gt;
          &lt;/copy&gt;
      &lt;/target&gt;
  
      &lt;target name=&quot;compile.module.luckypick.tests&quot;
              depends=&quot;register.custom.compilers,compile.module.luckypick.production&quot;
              description=&quot;compile module LuckyPick; test classes&quot; unless=&quot;skip.tests&quot;/&gt;
  
      &lt;target name=&quot;clean.module.luckypick&quot; description=&quot;cleanup module&quot;&gt;
          &lt;delete dir=&quot;${luckypick.output.dir}&quot;/&gt;
          &lt;delete dir=&quot;${luckypick.testoutput.dir}&quot;/&gt;
      &lt;/target&gt;
  
      &lt;target name=&quot;init&quot; description=&quot;Build initialization&quot;&gt;
          &lt;!-- Perform any build initialization in this target --&gt;
      &lt;/target&gt;
  
      &lt;target name=&quot;clean&quot; depends=&quot;clean.module.luckypick&quot; description=&quot;cleanup all&quot;/&gt;
  
      &lt;target name=&quot;build.modules&quot; depends=&quot;init, clean, compile.module.luckypick&quot; description=&quot;build all modules&quot;/&gt;
  
      &lt;target name=&quot;all&quot; depends=&quot;build.modules&quot; description=&quot;build all&quot;/&gt;
  &lt;/project&gt;
  </code></pre>
  <p>ant build output:</p>
  <p><img src="https://imgur.com/Ya95bwK.png" alt="ant build output" /></p>