English | 简体中文
Swing + FlatLaf + jpackage + Maven template project for generating native desktop applications.
- Build nice, small cross-platform Swing desktop apps with native installers
- Apx 30-40mb .dmg, .msi and .deb installers - check out the example builds in releases.
- Note that the macOS builds are not signed, and therefore macOS will report as damaged/unopenable. There are a few ways to deal with this, depending on your situation.
- Just use Maven - no shell scripts required.
- Use standard Maven dependency system to manage dependencies
- Generate macOS (.dmg), Windows (.msi) and Unix (e.g. deb/rpm) installers/packages automatically with GitHub Actions.
- Install OpenJDK Java 17 or
Oracle Java 17.
- Verify by opening a fresh Terminal/Command Prompt and typing
java --version
.
- Verify by opening a fresh Terminal/Command Prompt and typing
- Install Apache Maven 3.6.3 or later and make sure it's on your path.
- Verify this by opening a fresh Terminal/Command Prompt and typing
mvn --version
.
- Verify this by opening a fresh Terminal/Command Prompt and typing
- macOS: verify XCode is installed and needed agreements accepted.
- Launch XCode and accept the license, or verify in Terminal with the command
sudo xcodebuild -license
.
- Launch XCode and accept the license, or verify in Terminal with the command
- Windows: install Wix 3 binaries.
- Installing Wix via the installer should be sufficient for jpackage to find it.
- Clone/download this project.
- Final step: run
mvn clean install
from the root of the project to generate thetarget\TestApp.dmg
ortarget\TestApp.msi
(installer).- Note that the actual generated installer will include a version number in the file name.
Because these builds use stripped down JVM images, the generated installers are in the 30-40mb range.
On macOS you should add signing to avoid error messages related to the security system(s).
To generate an installer, just run...
mvn clean install
To do everything up until the actual installer generation (including generating the custom JVM)...
mvn clean package