Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I export a tornadofx application?

I finished writing a little tornadofx app in IntelliJ CE and now want to export it as a single file which can be downloaded and launched by users. For now it would be sufficient to provide a single jar file. But it would be also great to know on how to export a self contained installer for OSX, Windows and Linux. Unfortunately I don't know how to do any of that. Can you help?

like image 401
stoefln Avatar asked Jun 18 '26 02:06

stoefln


2 Answers

Have a look at the FxLauncher project, which is also from the creator of tornadoFX. FXLauncher allows you to easily distribute your javafx/tornadoFX application. The project provides a maven-plugin which allows you to generate a self containing javafx/tornadoFX application that you then publish to a web-server or common directory (e.g an internal app in your company network). After that you can generate native installers for Linux, OSX and Windows. The installer itself will only install a small app, which will know the location of your web-serve or directory. On startup it will download the latest deployed version of you application and run it. Additional links:

  • GitHub-project
  • Introduction screen cast
  • Customizing update ui
like image 121
nimakro Avatar answered Jun 20 '26 17:06

nimakro


In case you want a single jar file, you can export it as a regular Java program (not the JavaFX option in IntelliJ). You do this by creating and building an artifact.

  • Go to the Project Structure window, and from there select Artifacts
  • Click the "+" icon to create a new artifact, and select JAR > From modules with dependencies...
  • Select the main class and press OK

And that's it, the artifact has been set up, now, to generate jar file, just go to Build > Build Artifacts menu, and select the newly-made artifact, and the IntelliJ will generate the jar file in the "out" directory.

Not sure if this is the best solution, but it's what I've been using, and it works for me.

like image 39
Aleksandar Stefanović Avatar answered Jun 20 '26 16:06

Aleksandar Stefanović