Modify

Opened 4 years ago

Closed 12 months ago

Last modified 10 months ago

#17083 closed enhancement (fixed)

Create jlink / jpackage native runtimes

Reported by: Don-vip Owned by: Don-vip
Priority: major Milestone: 21.08
Component: Core Version:
Keywords: java11 javafx webstart jlink jpackage windows macosx Cc: stoecker, simon04, floscher, michael2402, wiktorn

Description

With the end of Java WebStart and public JRE availability from Oracle (end of 2020) we need to find another deployment technology that matches our needs:

  • still offer a simple jar for power users, and Linux distributions that include the Java and JavaFX runtimes, as they manage the security updates themselves
  • provide a simple way for Windows and macOS users to get JOSM, Java and JavaFX runtimes
  • provide a light mechanism to get JOSM latest updates every day
  • make sure users get Java security updates if we ship the runtimes ourselves

Java 9 introduced a new tool (jlink) to create custom Java runtimes that only include the classes needed for an application. It allows to create smaller runtimes and also gives a significant boost when starting the JVM (less stuff to load).

I never considered it seriously until today because jlink does not allow cross-platform builds. So if we go this way, we need to get three build servers (Linux, Windows, macOS).

I found today an open source project that managed to do it. The results in size are quite impressive (less than 40 Mb). This is achieved using Azure Pipelines: Microsoft provides a free offer for open source projects (10 free parallel jobs with unlimited minutes).

I will try to build native runtimes with OpenJDK 11, JavaFX 11 and JOSM to see if it works :)

Attachments (1)

josmlic.png (11.6 KB) - added by Don-vip 12 months ago.

Download all attachments as: .zip

Change History (39)

comment:1 Changed 4 years ago by Don-vip

Summary: Create jlink native runtimes using Azure PipelinesCreate jlink native runtimes

Ah it seems I totally misunderstood what jlink was capable of. We cannot create a single image that runs on different OS, but we should be able on a given host to create images targeted for a different OS. So we might not need the Microsoft offer at all, if we can create the images on our Linux server.

comment:2 Changed 12 months ago by Don-vip

Keywords: jlink jpackage added
Summary: Create jlink native runtimesCreate jlink / jpackage native runtimes

In the course of #18319 a jpackage-based script (which uses jlink under the hood) has been developed for macOS. Could be useful for Windows too.

Last edited 12 months ago by Don-vip (previous) (diff)

comment:3 Changed 12 months ago by Don-vip

In 18136/josm:

see #17083 - generate jpackaged application on Windows too

comment:4 Changed 12 months ago by Don-vip

Milestone: Longterm

comment:5 Changed 12 months ago by Don-vip

In 18137/josm:

see #17083 - fix paths in macos script

comment:6 Changed 12 months ago by Don-vip

In 18138/josm:

see #17083 - fix Windows installer package generation

comment:7 Changed 12 months ago by Don-vip

In 18139/josm:

see #17083 - fix Windows installer package generation, smarter steps rules

comment:8 Changed 12 months ago by Don-vip

In 18140/josm:

see #17083 - simpler rules

comment:9 Changed 12 months ago by Don-vip

In 18142/josm:

see #17083 - sign jar files built on Github

comment:10 Changed 12 months ago by Don-vip

In 18143/josm:

see #17083 - sign jar files built on Github (forgot to export environment variable to Ant process)

comment:11 Changed 12 months ago by Don-vip

In 18145/josm:

see #17083 - make restart work with jpackage-based applications

comment:12 Changed 12 months ago by Don-vip

In 18146/josm:

see #17083 - sign MSI file

comment:13 Changed 12 months ago by Don-vip

In 18147/josm:

see #17083 - sign MSI file (forgot to export environment variables to script)

comment:14 Changed 12 months ago by Don-vip

comment:15 Changed 12 months ago by Don-vip

In 18149/josm:

see #17083 - Add Windows 10 SDK to PATH to locate signtool

comment:16 Changed 12 months ago by Don-vip

In 18151/josm:

see #17083 - another attempt to locate signtool, don't know exactly where it is

comment:17 Changed 12 months ago by Don-vip

In 18152/josm:

see #17083 - hopefully use correct signtool location

see https://github.com/JOSM/josm/pull/74#issuecomment-903098087

comment:18 Changed 12 months ago by Don-vip

In 18153/josm:

see #17083 - use signtool.exe extension, hopefully it will work...

comment:19 Changed 12 months ago by Don-vip

In 18154/josm:

see #17083 - setup GITHUB_PATH in a dedicated step

Rationale: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path

Prepends a directory to the system PATH variable and makes it available to all subsequent actions in the current job; the currently running action cannot access the updated path variable.

comment:20 Changed 12 months ago by Don-vip

In 18155/josm:

see #17083 - build both exe and msi windows installers, include JOSM version in filename, add additional console launcher

Changed 12 months ago by Don-vip

Attachment: josmlic.png added

comment:21 Changed 12 months ago by Don-vip

@stoecker: right now the jpackage-based Windows installer installs JOSM silently without any GUI.
There is a --license option which displays a GUI to ask user for license agreement:


Is it something we want for JOSM? The text will always be displayed in English.

comment:22 Changed 12 months ago by stoecker

The GPL is no EULA. It must not be accepted to use the software, so I don't think that's useful.

comment:23 in reply to:  22 Changed 12 months ago by Don-vip

Replying to stoecker:

The GPL is no EULA. It must not be accepted to use the software, so I don't think that's useful.

OK, thanks!

comment:24 Changed 12 months ago by Don-vip

In 18157/josm:

see #17083 - add win menu / win shortcut, fix github workflow

comment:25 Changed 12 months ago by Don-vip

In 18161/josm:

see #17083, see #17858 - include JavaFX 16 in macOS/Windows packages

comment:26 Changed 12 months ago by Don-vip

With r18161 package size increased as expected from ~40 to ~70 Mb.

comment:27 Changed 12 months ago by Don-vip

Milestone: Longterm21.08

comment:28 Changed 12 months ago by Don-vip

In 18162/josm:

see #17083 - fix #11398 - per-user-install of Windows jpackage installer

comment:29 Changed 12 months ago by Don-vip

In 18163/josm:

see #17083 - fix #4920 - setup a win-upgrade-uuid to properly upgrade JOSM installation at each new version

comment:30 Changed 12 months ago by Don-vip

In 18164/josm:

see #17083 - override WixUI default bitmaps with JOSM logo

comment:31 Changed 12 months ago by Don-vip

In 18165/josm:

see #17083 - drop old NSIS/Launch4J Windows installer

comment:32 Changed 12 months ago by Don-vip

Resolution: fixed
Status: assignedclosed

And I guess this is fixed!

comment:33 Changed 12 months ago by Don-vip

Keywords: windows macosx added

comment:34 Changed 12 months ago by Don-vip

Priority: normalmajor

comment:35 Changed 12 months ago by Don-vip

In 18168/josm:

see #17083 - Github Windows runner sometimes uses D:\ drive too

comment:36 Changed 12 months ago by Don-vip

In 18169/josm:

see #17083 - remove distwin target

comment:37 Changed 12 months ago by Don-vip

In 18172/josm:

see #17083 - update eclipse project with native/windows/locale being gone

comment:38 Changed 10 months ago by skyper

The documentation needs to be adapted, now, see #21411.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.