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!
Yuri Trukhin says:
March 26, 2013Thank you:)
Maciej Matecki says:
March 30, 2013Thanks. 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.
Cheers,
Maciej.
Anna Kozlova says:
April 1, 2013Maciej, 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.
Thanks
Gerrit says:
April 4, 2013Any 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,
Gerrit
Anna Kozlova says:
April 4, 2013Gerrit, ok, we do it.
Anna Kozlova says:
April 5, 2013Done, but would be available only in 12.1.2 EAP (after 12.1.1 is out)
Sebastian says:
April 21, 2013I’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
Sebastian says:
April 21, 2013security
all-permissions
security
the previous comment had this missing for the 1 thing
Danno Ferrin says:
April 12, 2014What are your plans (if any) for the packaging updates coming in 8u20? Ping me offline if desired.
lavan says:
April 22, 2014Hi,
How will i run then app then ? can someone please explain completely with a simple example.
Thanks in advance
Lavan
Costas says:
October 22, 2014How 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.
Alex Zaldivar says:
December 10, 2014I second what Costas wrote. Give an example because NetBeans does this already.
Milan Bojovic says:
November 27, 2015Thank you – it worked for me
Joël Phaka says:
December 2, 2015I get this error:
Error:Java FX Packager:
BUILD FAILED
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
outadoc says:
June 19, 2016I have the same problem, have you found a solution since then?
PAN says:
August 22, 2016The same issue
John Smith says:
September 8, 2019Try removing any funny characters with umlauts (ö,ä,å,û etc) from your application details on the JavaFX tab.
Max says:
August 2, 2018I cannot run my artifact, it says my output is a directory and says error along with JavaFX packager.
https://gyazo.com/1aea443c0361fe54fd07e9eb27047f78
Huang Fu Chuang says:
December 5, 2018Not found FXML file after packaging!!
Laurent says:
May 11, 2019Same problem. How did you solve it?
J says:
August 20, 2019Error:Java FX Packager: Can’t build artifact – fx:deploy is not available in this JDK
Whats the most straightforward process for overcoming this issue?