Configuring JavaFX Project on IntelliJ

I’ve had a hard time just to get a JavaFX project going with IntelliJ on Java 11. After spending 2 nights of digging and Googling, I finally got “Hello World” window to show up.

I will try to summarize what I have done.


I have decided to manage dependencies and build with maven. Here is the pom.xml file I created. Right click on the project in Project window and select All Frameworks Support to add Maven support to the project.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""



VM options

I’m sure the module path may be different depending your installation but here is the VM options I gave in Run/Debug Configurations. (Run -> Edit Configurations) This is necessary because JDK does not contain JavaFX by default anymore.

--module-path "/usr/share/openjfx/lib" --add-modules javafx.controls,javafx.fxml


Navigate to File -> Project Structure -> Project. Make sure you select 11 – Local variable syntax for lambda parameters in Project language level.

Language Level

Navigate to File -> Project Structure -> Modules. Select 11 – Local variable syntax for lambda parameters for Language level in Sources tab.11 - Local variable syntax for lambda parameters

Target bytecode version

Navigate to File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler. Select 11 for Target bytecode version.

Target bytecode version


There are many options to create cross platform desktop applications and JavaFX is one of them. I hope JetBrain will streamline the way to create JavaFX project easily in the future. I have uploaded the code to my GitHub repository.