Packaging JavaFX 2 Applications in IntelliJ IDEA 12.1

This is the third part of the JavaFX 2 serie about the new features coming in IntelliJ IDEA 12.1. Today we would like to show how you can prepare your application deployment bundles.

Since the last two posts we have updated the project wizard so when you create a project it comes with an already configured artifact.

If you accept to create a project and open File → Project Structure → Artifacts, you will see a configured artifact of JavaFx Application type.

You can specify to build this artifact on each make by enabling corresponding option here or you can build it manually when you need it via Build → Build Artifacts… action. Specific JavaFX settings such as Application class, Title, Vendor, etc are hidden on the JavaFX tab.

All required fields are already set for you so you can try to build your first JavaFX application right after project creation. If you need to pass additional settings you can generate an ant build via Build → Generate Ant Build… and pass everything you need in the generated build file. You can also attach an ant task to be performed on make or before any run configuration.

And the last one for today. If your application already needs a preloader you can configure additional artifact for a module with the preloader.

This artifact will ask you to specify your preloader class and define the preloader.jar layout. If you add this artifact in the JavaFx Application artifact dependencies IntelliJ IDEA will use specified preloader to prepare resulted bundle.

You need additional settings for your JavaFX applications in UI? Please don’t hesitate to ask.

Feel free to share your feedback on the discussion forum and report bugs in our issue tracker.

Develop with Pleasure!

Comments below can no longer be edited.

21 Responses to Packaging JavaFX 2 Applications in IntelliJ IDEA 12.1

  1. Avatar

    Yuri Trukhin says:

    March 26, 2013

    Thank you:)

  2. Avatar

    Maciej Matecki says:

    March 30, 2013

    Thanks. It’s really helpful. Could you add option as for the JAR artifact (From modules with dependencies) so the MANIFEST.MF will have the Classpath property set for JavaFX artifacts.

  3. Avatar

    Anna Kozlova says:

    April 1, 2013

    Maciej, sorry I am not sure that I do understand you correctly. Do you need just to configure classpath dependencies in generated manifest file when build multi-module project or module with library dependencies? Hopefully I’ve already fixed that bug.

  4. Avatar

    Gerrit says:

    April 4, 2013

    Any chance to implement native packaging in the ui or do we have to use the javafx ant tasks to build native packages ?
    Cheers and keep up the great work,


  5. Avatar

    Anna Kozlova says:

    April 4, 2013

    Gerrit, ok, we do it.

  6. Avatar

    Anna Kozlova says:

    April 5, 2013

    Done, but would be available only in 12.1.2 EAP (after 12.1.1 is out)

  7. Avatar

    Sebastian says:

    April 21, 2013

    I’m missing 2 things here:

    1) the security that make me run in browser theres is no way I can see of configure the jnlp with

    2) as other comment, if I add the dependency jars on a lib folder the jnlp never get them and never add the path, so the poject fails to run

  8. Avatar

    Sebastian says:

    April 21, 2013


    the previous comment had this missing for the 1 thing

  9. Avatar

    Danno Ferrin says:

    April 12, 2014

    What are your plans (if any) for the packaging updates coming in 8u20? Ping me offline if desired.

  10. Avatar

    lavan says:

    April 22, 2014


    How will i run then app then ? can someone please explain completely with a simple example.

    Thanks in advance


  11. Avatar

    Costas says:

    October 22, 2014

    How about including a native icon file for each bundle? In netbeans it is match easier to set an icon file without writing any single line of ant etc. I find it very hard to do so in intellij and I am thinking of switching to netbeans just because of that. Please give a (working) example of setting up an icon.

  12. Avatar

    Alex Zaldivar says:

    December 10, 2014

    I second what Costas wrote. Give an example because NetBeans does this already.

  13. Avatar

    Milan Bojovic says:

    November 27, 2015

    Thank you – it worked for me

  14. Avatar

    Joël Phaka says:

    December 2, 2015

    I get this error:

    Error:Java FX Packager:
    Error reading project file C:\Users\Joël Phaka\.IntelliJIdea14\system\compile-server\_temp_\build0.xml: Invalid byte 2 of 3-byte UTF-8 sequence.

    Total time: 0 seconds

    • Avatar

      outadoc says:

      June 19, 2016

      I have the same problem, have you found a solution since then?

      • Avatar

        PAN says:

        August 22, 2016

        The same issue

        • Avatar

          John Smith says:

          September 8, 2019

          Try removing any funny characters with umlauts (ö,ä,å,û etc) from your application details on the JavaFX tab.

  15. Avatar

    Max says:

    August 2, 2018

    I cannot run my artifact, it says my output is a directory and says error along with JavaFX packager.


  16. Avatar

    Huang Fu Chuang says:

    December 5, 2018

    Not found FXML file after packaging!!

    • Avatar

      Laurent says:

      May 11, 2019

      Same problem. How did you solve it?

  17. Avatar

    J says:

    August 20, 2019

    Error:Java FX Packager: Can’t build artifact – fx:deploy is not available in this JDK

    Whats the most straightforward process for overcoming this issue?

Discover more