Skip to content

IntelliJ Exe build not working as I expected

I am working on a JavaFX Application, which is a conferencing application. The application is running fine with IDEA. But my target is to build an exe from my application which would run standalone. I have configured an Artifact to build exe where I set the values for

  1. Application Class
  2. Title
  3. Vendor
  4. Version
  5. Native Bundle (exe)
  6. Enable Signing with Self Signed Key.
  7. Build Output Level (Default).

With this, I can successfully build the exe file. When I install this exe, it doesn’t run. My application has some dependency on other java libraries, which I have included in Output Root as Extracted. I have found that,

  1. When I run the installed application it simply does nothing and simply exits without error. I haver tried to the run exe from cmd as well, but same here.
  2. When I try to run the jar file of my application it it runs successfully.

though I have added these two lines in the MANIFEST file I am using, Manifest-Version: 1.0 Main-Class: sample.Main

I have tried and many other solutions from internet. But nothing helped me in my case.

How can I debug this exe file or my project to successfully build an exe?


Thanks you guys. I have solved the problem.

My problem was, I was using

Platform.runLater(() -> {
    //some code here

Before launch(args); was called in the main Method. Which is fine if I run the program from IDEA (In my case it was IntelliJ) or if I run the program using java -jar MyJar.jar from command prompt. But it doesn’t work when I run it from exe (An exception occurs in this case

java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(
at com.sun.javafx.application.PlatformImpl.runLater(
at javafx.application.Platform.runLater(


How To Debug

I had to put my whole code of main method inside a try catch block, and had to write the exception in a file or print the exception in the console.


If I put PlatformImpl.startup(() -> {}); and change my code to

PlatformImpl.startup(() -> {});
Platform.runLater(() -> {
    //some code here

then it works.

thanks to