<div dir="ltr">On Sun, 03 Dec 2023 16:09:54 +0100 Markus Koschany <<a href="mailto:apo@debian.org">apo@debian.org</a>> wrote:<br>> On Tue, 28 Nov 2023 17:59:18 +0100 Joan <<a href="mailto:aseques@gmail.com">aseques@gmail.com</a>> wrote:<br>> > Package: tomcat10-common<br>> > Version: 10.1.15-1<br>> > Severity: normal<br>> > X-Debbugs-Cc: <a href="mailto:aseques@gmail.com">aseques@gmail.com</a><br>> > <br>> > Dear Maintainer,<br>> > <br>> >    * What led up to the situation?<br>> > I am trying to use debian's tomcat 10 with java 21, since it's not present on<br>> debian I used the one from <br>> > <a href="https://adoptium.net/installation/linux/">https://adoptium.net/installation/linux/</a> that has a repository.<br>> <br>> [...]<br>> <br>> Hello,<br>> <br>> we support only OpenJDK and there is even openjdk-21-jre in unstable. For<br>> stable releases only one version of openjdk is supported in general, currently<br><div>> OpenJDK 17.</div><div><br></div><div>While I understand the logic of not searching for every vendor-specific pattern possible (even if Temurin is growing close to a standard), what about relying on the "alternatives" system (which is definitely a standard on Debian)? It feels more future-proof than some custom pattern-based matching, and that would cover any vendor that properly registers there. It would be more consistent with the fact that the package uses the very generic virtual packages as dependencies, which usually match all vendors that provide Debian packages (like Temurin).</div><div><br></div><div>For example something like this (to use the current default whatever it is):</div><div><br></div><div>JAVA_BIN=$(update-alternatives --query java 2>/dev/null | sed -n 's/^Value: //p')<br>if [ -n "$JAVA_BIN" ]; then<br>    JAVA_HOME=$(dirname "$(dirname "$JAVA_BIN")")<br>fi</div><div><br></div><div>Or, if you want to keep the currrent logic of enforcing a range of supported versions, something like the following (warning: quick LLM-suggested version script which can probably be written better):</div><div><br></div><div>find_jdks()<br>{<br>    for java_version in 25 24 23 22 21 20 19 17<br>    do<br>        # Any JDK registered in the java alternatives, whatever its vendor/layout<br>        for java_bin in $(update-alternatives --list java 2>/dev/null || true)<br>        do<br>            jvmdir=$(dirname "$(dirname "$java_bin")")<br>            if [ -r "$jvmdir/release" ] && \<br>               grep -q "^JAVA_VERSION=\"${java_version}[.\"]" "$jvmdir/release"<br>            then<br>                JDK_DIRS="${JDK_DIRS} ${jvmdir}"<br>            fi<br>        done<br>        for jvmdir in /usr/lib/jvm/java-${java_version}-openjdk-* \<br>                      ... (existing patterns unchanged)</div><div><br></div><div>Thanks,</div><div>--</div><div>Thomas Mortagne</div></div>