Skip to content

How to package into MacOS app #531

Description

@ShoddyShoe

It is possible, and quite easy, to bundle the jar file with a jre into a single .app file that can be run like any other application. All you need is jpackage which (I believe) comes bundled with the built-in macos java install.

Tested With:
Late 2020 M1 Mac Mini
macOS Sequoia 15.4
zulu21.32.17-ca-fx-jre21.0.2-macosx_aarch64
mcaselector-2.5.1.jar

  1. Create a new folder and place the following inside:
    MCA Selector's jar (mcaselector-_x_._x_._x_.jar)
    Zulu's full folder (zulu21.x.x-ca-fx-jre.21.x.x-macosx_aarch64 (or x64))
    An icon for the app (app-icon.icns) (If you need one)

  2. Open your terminal of choice and navigate into said folder
    ex. cd ~/Downloads/appfolder

  3. Finally, copy-paste the following into the terminal and hit enter:

jpackage \
--name "MCA Selector" \
--input . \
--main-jar mcaselector*.jar \
--runtime-image zulu21*/zulu-21.jre/Contents/Home \
--type app-image \
--dest /Applications \
--icon *.icns
  1. Launch MCA Selector.app
    Open your Applications folder (/Applications)
    Look for "MCA Selector" or "MCA Selector.app"
    Double click and enjoy!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions