# Package JavaFX applications

You can package your JavaFX application by building the corresponding artifact (a Java archive). For JavaFX applications, IntelliJ IDEA provides a dedicated artifact type: JavaFx Application.

> **Warning:**
> Packaging a JavaFX application in `.jar` is possible only with Java 8. For Java 11 and later, use the [jlink tool
> to package your application](javafx.html#package-app-with-jlink).

## Build JavaFX artifacts

Procedure: Create a new artifact configuration

IntelliJ IDEA creates the artifact for packaging the application together with the project. However, you can create a new artifact configuration with your custom settings.

1. In the main menu, go to `File | Project Structure` `Ctrl+Alt+Shift+S` (Windows), `⌘ ;` (macOS), `⌘ ;` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ Comma` (macOS System Shortcuts), `Ctrl+Alt+Shift+S` (XWin), `Ctrl+Alt+Shift+S` (GNOME), `Ctrl+Alt+Shift+S` (KDE), `Ctrl+Alt+Shift+S` (Emacs), `Ctrl+Alt+Shift+S` (Sublime Text), `⌘ ;` (Sublime Text (macOS)), `Ctrl+Alt+Shift+S` (NetBeans), `Ctrl+Alt+Shift+S` (Visual Studio), `⌘ ;` (Visual Studio (macOS)), `Ctrl+Alt+Shift+S` (Eclipse), `⌘ ;` (Eclipse (macOS)) and click Artifacts.

2. Click ![the Add button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.general.add.svg), point to JavaFx Application, and select From module '...'.

![Creating a new artifact configuration](https://resources.jetbrains.com.cn/help/img/idea/2026.2/fx-new-artifact.png)

IntelliJ IDEA creates the artifact configuration and shows its settings in the right-hand part of the Project Structure dialog.

3. Name the new configuration.

4. Switch to the JavaFX tab and in the Application class field, specify the `main()` method.

5. Apply the changes and close the dialog.

![Creating a new artifact configuration: specifying the main class](https://resources.jetbrains.com.cn/help/img/idea/2026.2/fx-new-artifact-main.png)

> **Tip:**
> This is a basic configuration that is sufficient to package an application. You can specify additional options on the JavaFX tab. For the detailed description of each option, refer to [Java FX tab](project-structure-artifacts-java-fx-tab.html).

Procedure: Build the artifact

1. In the main menu, go to `Build | Build Artifacts`.

2. In the popup that opens, select the necessary artifact and select Build.

By default, the artifact is generated to `<project_folder>\out\artifacts\<artifact_name>`.

> **Tip:**
> If you want to make sure that your artifact is built correctly, create a new run configuration and run it as described in the section [Run the packaged application](creating-and-running-your-first-java-application.html#run_jar_artifact).

## Troubleshoot

* `Error:Java FX Packager: Can't build artifact – fx:deploy is not available in this JDK` The `fx:deploy` task was a part of the Ant plugin that was formerly distributed in `ant-javafx.jar` as a part of Java Packager. The Ant plugin is not included in jpackage in the current JDK versions. If you're using a JDK build of version 9 and later, use third-party solutions for packaging. For example, refer to section [Runtime images](https://openjfx.io/openjfx-docs/#modular) in the JavaFX official documentation. You can find more options for packaging on [Stack Overflow](https://stackoverflow.com/a/30162808). You can package your application using [jlink](javafx.html#package-app-with-jlink) or use a JDK with JavaFX included, for example, the [Bellsoft Liberica](https://bell-sw.com/) JDK 11.

