Modify

Opened 7 weeks ago

Last modified 7 weeks ago

#23564 new task

Java 21 migration

Reported by: taylor.smock Owned by: team
Priority: normal Milestone: Longterm
Component: Core Version:
Keywords: java21 Cc: stoecker, sebastic

Description (last modified by skyper)

Followup of #17858

Timelines:

  • 2023-10-03: Build installer packages with Java 21 => r18848
  • 2023-12-21: OpenWebStart supports Java 21
  • 2024-03-20: Update Debian/Ubuntu launch script to prefer 21 over 17 and 11 => r19018
  • ????-??-??: Debian switches to Java 21 (experimental is on Java 21 as of 2024-03-20)
  • ????-??-??: Ubuntu LTS switches to Java 21
  • ????-??-??: Enough users have switched to Java 21 that we can move codebase to Java 21 after transition phase
  • ????-??-??: Start warning users that their version of Java will be unsupported during startup (1 month), then stop allowing JOSM to finish startup (1-3 months), then start compiling JOSM with Java 21 features.

Attachments (0)

Change History (13)

comment:1 by taylor.smock, 7 weeks ago

Cc: stoecker added

@stoecker: What is the process for changing the Java versions for the mac/windows installers? I assume it is something that needs to be changed server side.

comment:2 by stoecker, 7 weeks ago

No. These are all done on GitHub, so it's in the SVN GitHub stuff.

in reply to:  description comment:3 by skyper, 7 weeks ago

Replying to taylor.smock:

  • ????-??-??: Update Debian/Ubuntu launch script to prefer 21 over 17 and 11.
  • ????-??-??: Debian switches to Java 21 (experimental is on Java 21 as of 2024-03-20)

I do not think it is feasible to wait for default-jre to switch to 21 but openjdk-21-jre should be available in the stable release (currently bookworm) at least as backport. At the moment it is available in the testing release (trixie) so I would say it is fine to already prefer 21 over 17 and 11.

in reply to:  2 ; comment:4 by taylor.smock, 7 weeks ago

Replying to stoecker:

No. These are all done on GitHub, so it's in the SVN GitHub stuff.

Sorry, I should have been more explicit. I've already got GitHub building the Java 21 installers.

I suspect that the installers (e.g. download/windows/josm-setup.msi) are copied via something like curl -L https://github.com/JOSM/josm/releases/download/${VERSION}-tested/JOSM-Windows-java17-${VERSION}.msi, but I could be wrong.

Replying to skyper:

I do not think it is feasible to wait for default-jre to switch to 21 [...]

Fair enough. But I suspect that it might be awhile before we can switch to Java 21 in the build source (at least if we want to make life easier for the Debian packagers).

Last edited 7 weeks ago by skyper (previous) (diff)

comment:5 by stoecker, 7 weeks ago

Ah yes. There are two variables winjava and macjava ;-)

Should I change them to 21?

comment:6 by taylor.smock, 7 weeks ago

I think so; I haven't seen any Java 21 specific bugs in the past few months, so I think it is safe to change the installers to Java 21.

comment:7 by stoecker, 7 weeks ago

Done.

in reply to:  4 ; comment:8 by skyper, 7 weeks ago

Cc: sebastic added

Replying to taylor.smock:

Replying to skyper:

I do not think it is feasible to wait for default-jre to switch to 21 [...]

Fair enough. But I suspect that it might be awhile before we can switch to Java 21 in the build source (at least if we want to make life easier for the Debian packagers).

Well building with Java 21 is different and I, too, suspect that it will take years until we get there. Current stable release still has Java 11 as default and next release will have Java 17. Though, the Debian packages are build for all releases and as openjdk-21-jre is available in testing and unstable (trixie and sid) I would prefer 21 over 17 and 11 in the launch script, now.

comment:9 by taylor.smock, 7 weeks ago

In 19018/josm:

See #17858/#23564: Update Java versions in Linux start scripts

Additions:

  • Java 19-20 (EOL, added for completeness)
  • Java 21 (preferred LTS)
  • Java 22 (latest Java version)
  • Java 23 (next Java version)

Removals:

  • Java 8, 9, and 10: We no longer support Java < 11.

comment:10 by taylor.smock, 7 weeks ago

Description: modified (diff)
Type: defecttask

in reply to:  8 comment:11 by sebastic, 7 weeks ago

Description: modified (diff)
Type: taskdefect

Replying to skyper:

Replying to taylor.smock:

Replying to skyper:

I do not think it is feasible to wait for default-jre to switch to 21 [...]

Fair enough. But I suspect that it might be awhile before we can switch to Java 21 in the build source (at least if we want to make life easier for the Debian packagers).

Well building with Java 21 is different and I, too, suspect that it will take years until we get there. Current stable release still has Java 11 as default and next release will have Java 17. Though, the Debian packages are build for all releases and as openjdk-21-jre is available in testing and unstable (trixie and sid) I would prefer 21 over 17 and 11 in the launch script, now.

Just don't require Java 21 (i.e. don't fail to build with JDK 17) before it's available in (backports) for the current Debian stable release to keep backports of the josm package possible. While openjdk-21 is available in testing, it has not been backported.

You can prefer openjdk-21 over openjdk-17 by adding it to the launcher accordingly:

        # LTS versions in decreased order
        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-21-openjdk/bin/java /usr/lib/jvm/java-21-openjdk-$ARCH/bin/java"
        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-17-openjdk/bin/java /usr/lib/jvm/java-17-openjdk-$ARCH/bin/java"
        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"

https://josm.openstreetmap.de/browser/josm/trunk/native/linux/tested/usr/bin/josm#L23

Note that /etc/alternatives/java will be used as long as its included in JAVA_CMDS.

comment:12 by skyper, 7 weeks ago

Description: modified (diff)
Type: defecttask

comment:13 by taylor.smock, 7 weeks ago

@sebastic: I suspect you were writing your reply when I committed r19018 which added Java 21 LTS to the start script order.

Anyway, I suspect moving to Java 21 is a year or two out. I mostly opened this ticket so we can track progress of various blockers. We'll probably move to "requiring"[1] Java 17 (#17858) a few months after Ubuntu 24.04 is released and start allowing Java 11 features in the codebase, and then start using Java 17 features a few months after that.

[1] In this case, "requiring" means we stop JOSM startup if the Java version is < Java 17. This is supposed to (hopefully) give users a bit of time to click on the "Update Java" button before they start getting UnsupportedClassVersionError exceptions.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to taylor.smock.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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