From 12a5b9b9c20b996d959df5a7faf5ac010865f7c9 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:19:35 +0100 Subject: [PATCH] Fix JDK count variable initialization in setup_java (#9058) --- misc/tools.func | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/tools.func b/misc/tools.func index 157610d2f..c702edaa2 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -2787,8 +2787,9 @@ 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=0 + JDK_COUNT=$(dpkg -l 2>/dev/null | grep -c "temurin-.*-jdk" || echo "0") + if [[ -z "$INSTALLED_VERSION" && "${JDK_COUNT:-0}" -gt 0 ]]; then msg_warn "Found Temurin JDK but cannot determine version" INSTALLED_VERSION="0" fi