# Create a new JavaFX project

JavaFX is a software platform used for developing desktop applications that can run across a wide variety of devices.

JavaFX support in IntelliJ IDEA includes code completion, search, navigation and refactoring in JavaFX-specific source files (including `.fxml` and JavaFX `.css` files), integration with JavaFX Scene Builder, JavaFX application packaging capabilities, and more.

Procedure: Make sure the JavaFX plugin is enabled

To be able to work with JavaFX in IntelliJ IDEA, the JavaFX bundled plugin must be enabled:

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Switch to the Installed tab and make sure that the JavaFX plugin is enabled.

If the plugin is disabled, select the checkbox next to it.

3. Apply the changes and close the dialog.  Restart the IDE if prompted.

Procedure: Create a new project

> **Note:**
> Java 11 or later is required to create JavaFX applications.

When you create a new JavaFX project, IntelliJ IDEA generates a fully configured sample application.

1. Launch IntelliJ IDEA.

If the Welcome screen opens, click New Project. Otherwise, go to `File | New | Project` in the main menu.

2. From the Generators list on the left, select JavaFX.

3. Name the new project, change its location if necessary, and select a language, and a build system.

4. In the Group field, specify the name of the package that will be created together with the project.

5. From the JDK  list, select the [JDK](sdk.html#jdk) that you want to use in your project.

* If the JDK is installed on your computer, but not defined in the IDE, select ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.expui.nodes.jdk.png) Add JDK from Disk… and specify the path to the JDK home directory.

* If you don't have the necessary JDK on your computer, select ![](https://resources.jetbrains.com/help/img/idea/2026.2/app-client.expui.general.download.svg) Download JDK .

Click Next.

![Creating a new JavaFX project](https://resources.jetbrains.com/help/img/idea/2026.2/new-project-javafx.png)

6. On the next step of the wizard, select the libraries that you want to use in your application and click  Create.

![Creating a new JavaFX project](https://resources.jetbrains.com/help/img/idea/2026.2/new-project-javafx-second.png)

Procedure: Run the application

1. Open the `HelloApplication.java` class, click the ![Run application](https://resources.jetbrains.com/help/img/idea/2026.2/app-client.expui.gutter.run.svg) icon in the gutter, and select Run 'HelloApplication.main()'.

The IDE starts compiling your code.

2. When the compilation is complete, the application window appears.

This means that the project is configured correctly and everything works as it should.

[Video](https://resources.jetbrains.com/help/img/idea/2026.2/fx-sample-app.mp4)

When you clicked Run, IntelliJ IDEA created a temporary [run configuration](run-debug-configuration.html) named after the `HelloApplication` class. You can view and edit this configuration: in the main menu, go to `Run | Edit Configurations`.

> **Note:**
> For more information about creating modular and non-modular projects with Maven or Gradle, refer to [Getting Started with JavaFX](https://openjfx.io/openjfx-docs/#IDE-Intellij).

## Package the application with jlink

JavaFX was removed from the JDK starting with Java 11. As a result, JavaFX libraries are no longer bundled with the JDK and are not automatically included when packaging your application into a `JAR` file.

To package your code with Java 11 and later, you can use the `jlink` tool that is bundled with the JDK. Maven and Gradle projects that you create in IntelliJ IDEA come with the corresponding tasks to call `jlink`.

This will build a folder with JRE and application executables. The resulting program will only work on the same operating system and architecture as the host. For example, Linux will produce Linux binaries, macOS will produce macOS binaries, and x64 will produce x64 binaries.

Maven:

Procedure:

* Press `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (NetBeans), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) twice to open Run Anything and run `mvn javafx:jlink`.

![Run JLink with Maven](https://resources.jetbrains.com/help/img/idea/2026.2/javafx_package_maven.png)

The IDE places the application to the `target | app` folder.

![Run JLink with Maven](https://resources.jetbrains.com/help/img/idea/2026.2/javafx_package_maven_success.png)

Gradle:

Procedure:

* Press `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (NetBeans), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) twice to open Run Anything and run `gradle clean jlink`.

![Run JLink with Maven](https://resources.jetbrains.com/help/img/idea/2026.2/javafx_package_gradle.png)

The IDE places the application to the `build | image` folder.

![Run JLink with Maven](https://resources.jetbrains.com/help/img/idea/2026.2/javafx_package_gradle_success.png)

## Troubleshoot

* `Process finished with exit code -1073740791 (0xC0000409)` The problem is caused by an error in the NVIDIA driver. Update your driver to the latest version. For more information, refer to the [community forum](https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000060510-Process-finished-with-exit-code-1073740791-0xC0000409-JavaFX-Application).

* `"..." cannot be opened because the developer cannot be verified.` The problem is caused by [notarization](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) in macOS software. Follow the steps in the [discussion](https://github.com/hashicorp/terraform/issues/23033) to resolve the problem.

## See also

### External Links

[https://openjfx.io/openjfx-docs/#IDE-Intellij](https://openjfx.io/openjfx-docs/#IDE-Intellij) [Blog post: IntelliJ IDEA and JavaFX](https://blog.jetbrains.com/idea/2021/01/intellij-idea-and-javafx/) [JavaFX: Cross-platform UI development in Java on desktop, mobile and embedded clients (Video)](https://www.youtube.com/watch?v=JbITM8xapIQ)

