All Projects → wiverson → Maven Jpackage Template

wiverson / Maven Jpackage Template

Licence: apache-2.0
Sample project illustrating building nice, small cross-platform JavaFX-based desktop apps with native installers while still using the standard Maven dependency system.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Maven Jpackage Template

vic2 economy analyzer
Victoria 2 savegame economy analyzer, updated version
Stars: ✭ 44 (-40.54%)
Mutual labels:  maven, javafx
LogoRRR
A log viewer which visualises log events such that it is easy to identify problems or events of interest. This app was implemented using Scala and JavaFX, GluonHQ toolchain and GraalVM as platform.
Stars: ✭ 40 (-45.95%)
Mutual labels:  maven, javafx
Azkar-App
Desktop Application 💻 for Calculating Muslim prayer times 🕌 , Morning and Nights Azkar 🤲 with notification for random Azkar that pops-up in specific time.
Stars: ✭ 64 (-13.51%)
Mutual labels:  maven, javafx
lib-preferences
Lib-Preferences is a library for easy storing simple data to a Preferences.properties file in a Java(FX) & Maven desktop application.
Stars: ✭ 12 (-83.78%)
Mutual labels:  maven, javafx
Javafx Maven Plugin
Maven plugin for JavaFX
Stars: ✭ 764 (+932.43%)
Mutual labels:  javafx, maven
Hellojpro
Stars: ✭ 46 (-37.84%)
Mutual labels:  javafx, maven
VickyWarAnalyzer
Victoria II war analyzer. Java 8 + JavaFX + Maven
Stars: ✭ 43 (-41.89%)
Mutual labels:  maven, javafx
openjfx-docs
Getting started guide for JavaFX 11
Stars: ✭ 70 (-5.41%)
Mutual labels:  maven, javafx
Samples
JavaFX samples to run with different options and build tools
Stars: ✭ 352 (+375.68%)
Mutual labels:  javafx, maven
Lib I18n
The library `Lib-I18N` allows a developer to bind a key-value pair of a `.properties` file to a [StringBinding]. This makes it very easy to change the language during runtime in a [JavaFX] application.
Stars: ✭ 40 (-45.95%)
Mutual labels:  javafx, maven
Drombler Fx
Drombler FX - the modular application framework for JavaFX.
Stars: ✭ 52 (-29.73%)
Mutual labels:  javafx, maven
Dolphin Platform
This repository contains all java related sources of the Dolphin Platform.
Stars: ✭ 69 (-6.76%)
Mutual labels:  javafx
Owlplug
Audio plugin manager. Small tool to manage VST plugin folders on Windows and MacOS.
Stars: ✭ 64 (-13.51%)
Mutual labels:  javafx
Scalaonandroid
A tutorial and examples of how to write Android apps in Scala 2.13
Stars: ✭ 61 (-17.57%)
Mutual labels:  javafx
Fxmaterialdesign
JavaFx Material Design Models (UI/UX) 🎉
Stars: ✭ 63 (-14.86%)
Mutual labels:  javafx
Fx Experience
fx-experience -> fx onscreen keyboard
Stars: ✭ 72 (-2.7%)
Mutual labels:  javafx
Shoppingmall
使用主流框架组合SSM开发,并引入新技术,全面丰富的一个商城项目
Stars: ✭ 69 (-6.76%)
Mutual labels:  maven
Fx Guice
Google Guice integration for FXML-based JavaFX applications
Stars: ✭ 61 (-17.57%)
Mutual labels:  javafx
Editor
基于JavaFx的Markdown编辑器
Stars: ✭ 61 (-17.57%)
Mutual labels:  javafx
Gamecomposer
GameComposer is a game authoring tool and also a game runtime environment targeting at desktop and mobile devices.
Stars: ✭ 59 (-20.27%)
Mutual labels:  javafx

JavaFX + Maven = Native Desktop Apps

JavaFX + jpackage + Maven template project for generating native desktop applications.

Gitter

Goal

  1. Build nice, small cross-platform JavaFX-based desktop apps with native installers
    • Apx 30-40mb .dmg, .msi and .deb installers - check out the example builds in releases.
  2. Just use Maven - no shell scripts required.
    • Use standard Maven dependency system to manage dependencies
  3. Generate macOS (.dmg), Windows (.msi) and Unix (e.g. deb/rpm) installers/packages automatically with GitHub Actions

Overview

This template uses a Maven plugin to generate a custom JVM and installer package for a JavaFX application.

The basic requirements are just Java 16 and Maven. Java 15 will work, although it requires a bit of setup.

  • On macOS XCode is required.
  • On Windows the free WiX Toolset is required.

The project includes GitHub Actions which automatically generate macOS, Windows, and Linux installers.

The generated installers come in at around 30-40mb. The example source in the project includes demonstrations of several native desktop features - for example, drag-and-drop from the Finder/Explorer, as well as a few macOS Dock integration examples. Removing the code and the demonstration dependendencies gets a "Hello World" build size closer to 30mb than 40mb.

Key Features

Here are few cool things in this template:

  • Only uses Java and Maven. No shell scripts required.
  • Includes sample GitHub Actions to build macOS, Windows and Linux installers
  • Demonstrates setting the application icon
  • Builds a .dmg on macOS, .msi on Windows, and .deb on Linux
  • Bundles the JavaFX SDK & modules to simplify getting started.
  • Template includes several examples of JavaFX / native desktop integration
    • Drag & drop with Finder / Explorer
    • Change the Dock icon dynamically on macOS
    • Menu on the top for macOS, in the window itself on Windows
    • Request user attention (bouncing dock icon) on macOS

Once you get started, you might find these lists of tutorials, tools, libraries for JavaFX and general Java desktop integration helpful.

Usage

Once everything is installed (see below) it's really easy to use:

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

Installation

  1. Install OpenJDK Java 16 or Oracle Java 16.
    • Verify by opening a fresh Terminal/Command Prompt and typing java --version.
  2. 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.
  3. 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.
  4. Windows: install Wix 3 binaries.
    • Installing Wix via the installer should be sufficient for jpackage to find it.
  5. Clone/download this project.
  6. Final step: run mvn clean install from the root of the project to generate the target\TestApp.dmg or target\TestApp.msi (installer).
    • Note that the actual generated installer will include a version number in the file name
    • For reference, here is a complete run log for a successful run.

Because these builds use stripped down JVM images, the generated installers are in the 30-40mb range.

Sponsor

This project is sponsored by ChangeNode.com - if you would like to add easy automatic updates, crash reporting, analytics, etc. to your Java/JavaFX desktop application, go check it out... and be sure to subscribe for more information about desktop Java development.

Help

Problems? Make sure everything is installed and working right!

  • Compiler not recognizing the --release option? Probably on an old JDK.
  • Can't find jdeps? Probably on an old JDK.
  • Can't find jpackage? Probably haven't set up your system to allow Java 15 to enable preview packages.
  • Unrecognized option: --add-modules jdk.incubator.jpackage
    • Could be a left-over MAVEN_OPTS setting when you switched from Java 15 to Java 16
    • If you are still on Java 15, you may not have MAVEN_OPTS set correctly.

If you need consulting support, feel free to reach out to ChangeNode.com.

Q&A

If you are using the template, browsing the Q&A is highly recommended.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].