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.