This is a template project to create a modularized JavaFX application. It uses Gradle for its build and includes The Badass JLink Plugin to create custom runtime images and platform specific applications with bundled runtimes with jpackage.
It includes Logback for logging and it comes with a reasonable default logging configuration that logs to STDOUT and
to a file at the path ${user.home}/app.log
The application is modularized so that slimmed down runtimes can be bundled with the application.
- Clone the project with
git clone https://github.com/mjparme/javafx-template.git <name-of-your-project>
(or fork it and create a clone of your fork) - Remove the
.git
directory so it is no longer tied to this repo - Execute
git init .
to put it back under version control - Push to a remote if you want
IntelliJ will happily configure itself from a Gradle build.
- Open IntelliJ
- File -> Open
- In the file chooser dialog select the directory that contains the local repository and press the
Open
button. IntelliJ will notice the directory has abuild.gradle
in it and then do its thing and in a few minutes you should be good to go. - To run it go to
MyApplication.java
and press the green arrow in the gutter next to the class name or next to themain()
method. Or you can open a terminal and execute./gradlew run
The project includes the Gradle Wrapper so no local installation of Gradle is needed.
./gradlew run
-- Pretty self explantory, will run the application../gradlew jpackage
-- Will package your app with a bundled runtime in a platform specific format. After this runs check thebuild/jpacakge
directory for the bundled runtimes. On a Mac this will be a.dmg
,.pkg
, and.app
file. On Windows it will be an.exe
and.msi
I think, and a.rpm
file on linux I think. I have only ever ran this on a Mac so on different platforms just run it and see what you get.