maintainer-approval requested: [Bug 293756] Mk/Uses/java.mk: prefer latest LTS openjdk : [Attachment 269337] git diff to change the order of preferred java version

[email protected] Fri, 03 Apr 2026 10:03:35 +0000
Newsgroups gmane.os.freebsd.devel.java
Message-ID <[email protected]/bugzilla/>
Ronald Klop <[email protected]> has asked freebsd-java (Nobody)
<[email protected]> for maintainer-approval:
Bug 293756: Mk/Uses/java.mk: prefer latest LTS openjdk
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D293756

Attachment 269337: git diff to change the order of preferred java version
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D269337&action=3Dedit



--- Comment #6 from Ronald Klop <[email protected]> ---
Created attachment 269337
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D269337&action=
=3Dedit
git diff to change the order of preferred java version

Ok, I incorporated the remarks you have.

See attachment for new patch.

This patch does not change anything about the usage of JAVA_DEFAULT.
JAVA_DEFAULT is still used as the preferred jdk, as it is currently.
The only thing the patch does is re-order the LTS/non-LTS versions.
Java.mk used to prefer the oldest jdk in the JAVA_VERSION range. Now it pre=
fers
LTS over non-LTS and it prefers newer versions over older versions.

Old:
JAVA_DEFAULT=3D21 JAVA_VERSION=3D8 11 17 22 =3D> 8 (prefer oldest)
JAVA_DEFAULT=3D21 JAVA_VERSION=3D17 21 25 =3D> 21 (prefer DEFAULT)
JAVA_DEFAULT=3D21 JAVA_VERSION=3D22 25 =3D> 22 (prefer oldest)

New:
JAVA_DEFAULT=3D21 JAVA_VERSION=3D8 11 17 22 =3D> 17 (prefer latest LTS)
JAVA_DEFAULT=3D21 JAVA_VERSION=3D17 21 25 =3D> 21 (no change, prefer DEFAUL=
T)
JAVA_DEFAULT=3D21 JAVA_VERSION=3D22 25 =3D> 25 (prefer LTS)

Taking into account what JDKs are already installed is unchanged and still
works as intended.

Of the 485 ports with USES=3Djava this change will only affect these 17 por=
ts:
biology/gkl: 8 11
databases/cassandra4: 8 11
devel/argouml: 8 11 17 18
devel/gradle5: 8 11
devel/jetbrains-sqlite: 17 21
devel/spark: 8 11 17
java/apache-commons-collections: 8 11 17 18 19 20
lang/kawa: 8 11
math/jacop: 8 11 17
misc/jbidwatcher: 8 11
multimedia/kodi: 8 11
net/activemq: 21 17
net/seda: 8 11 17 21
net/spread-j: 8 11
sysutils/logstash7: 17 11 8
sysutils/rundeck: 11 17
textproc/elasticsearch7: 21 17 11 8

All other java ports already compile with JAVA_DEFAULT or are pinned to a
specific jdk.

I will do some test runs to make sure everything still compiles.

Can you review the patch in the meantime?