From e6b42a2b86161c2afe04c9428864e526c599efb1 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 6 Nov 2025 10:07:10 +0100 Subject: [PATCH] Update tools.func --- misc/tools.func | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index c67e4de58..b55f1de1b 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -2791,8 +2791,10 @@ function setup_java() { fi # Validate INSTALLED_VERSION is not empty if matched - local JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || echo "0") - if [[ -z "$INSTALLED_VERSION" && "$JDK_COUNT" -gt 0 ]]; then + local JDK_COUNT + JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || echo "0") + JDK_COUNT=${JDK_COUNT//[^0-9]/} # Remove any non-numeric characters + if [[ -z "$INSTALLED_VERSION" && "${JDK_COUNT:-0}" -gt 0 ]]; then msg_warn "Found Temurin JDK but cannot determine version" INSTALLED_VERSION="0" fi