Modify

Opened 6 years ago

Closed 3 years ago

Last modified 3 years 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 3 years ago.

Download all attachments as: .zip

Change History (39)

comment:1 by Don-vip, 6 years ago

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 by Don-vip, 3 years ago

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 3 years ago by Don-vip (previous) (diff)

comment:3 by Don-vip, 3 years ago

In 18136/josm:

see #17083 - generate jpackaged application on Windows too

comment:4 by Don-vip, 3 years ago

Milestone: Longterm

comment:5 by Don-vip, 3 years ago

In 18137/josm:

see #17083 - fix paths in macos script

comment:6 by Don-vip, 3 years ago

In 18138/josm:

see #17083 - fix Windows installer package generation

comment:7 by Don-vip, 3 years ago

In 18139/josm:

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

comment:8 by Don-vip, 3 years ago

In 18140/josm:

see #17083 - simpler rules

comment:9 by Don-vip, 3 years ago

In 18142/josm:

see #17083 - sign jar files built on Github

comment:10 by Don-vip, 3 years ago

In 18143/josm:

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

comment:11 by Don-vip, 3 years ago

In 18145/josm:

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

comment:12 by Don-vip, 3 years ago

In 18146/josm:

see #17083 - sign MSI file

comment:13 by Don-vip, 3 years ago

In 18147/josm:

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

comment:15 by Don-vip, 3 years ago

In 18149/josm:

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

comment:16 by Don-vip, 3 years ago

In 18151/josm:

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

comment:17 by Don-vip, 3 years ago

In 18152/josm:

see #17083 - hopefully use correct signtool location

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

comment:18 by Don-vip, 3 years ago

In 18153/josm:

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

comment:19 by Don-vip, 3 years ago

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 by Don-vip, 3 years ago

In 18155/josm:

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

by Don-vip, 3 years ago

Attachment: josmlic.png added

comment:21 by Don-vip, 3 years ago

@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 by stoecker, 3 years ago

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

in reply to:  22 comment:23 by Don-vip, 3 years ago

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 by Don-vip, 3 years ago

In 18157/josm:

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

comment:25 by Don-vip, 3 years ago

In 18161/josm:

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

comment:26 by Don-vip, 3 years ago

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

comment:27 by Don-vip, 3 years ago

Milestone: Longterm21.08

comment:28 by Don-vip, 3 years ago

In 18162/josm:

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

comment:29 by Don-vip, 3 years ago

In 18163/josm:

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

comment:30 by Don-vip, 3 years ago

In 18164/josm:

see #17083 - override WixUI default bitmaps with JOSM logo

comment:31 by Don-vip, 3 years ago

In 18165/josm:

see #17083 - drop old NSIS/Launch4J Windows installer

comment:32 by Don-vip, 3 years ago

Resolution: fixed
Status: assignedclosed

And I guess this is fixed!

comment:33 by Don-vip, 3 years ago

Keywords: windows macosx added

comment:34 by Don-vip, 3 years ago

Priority: normalmajor

comment:35 by Don-vip, 3 years ago

In 18168/josm:

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

comment:36 by Don-vip, 3 years ago

In 18169/josm:

see #17083 - remove distwin target

comment:37 by Don-vip, 3 years ago

In 18172/josm:

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

comment:38 by skyper, 3 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.