From 8264231144c047f88538181c0ffdf1c19a1c5816 Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Sat, 11 Nov 2023 14:34:27 +0100 Subject: [PATCH] Use find to get JAVA_HOME --- alpine/entrypoint | 2 +- debian/entrypoint | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine/entrypoint b/alpine/entrypoint index 8b870f6b..5519cd53 100755 --- a/alpine/entrypoint +++ b/alpine/entrypoint @@ -4,7 +4,7 @@ interactive=$(if test -t 0; then echo true; else echo false; fi) set -eux -o pipefail ${EXTRA_SHELL_OPTS-} IFS=$'\n\t' -export JAVA_HOME=$(ls -d /usr/lib/jvm/*jdk*) +export JAVA_HOME=$(find /usr/lib/jvm/ -maxdepth 1 -name "*jdk*" -type d) # Configure Java unlimited strength cryptography if [ "${CRYPTO_POLICY}" = "unlimited" ]; then diff --git a/debian/entrypoint b/debian/entrypoint index 5121046d..d2a3a52f 100755 --- a/debian/entrypoint +++ b/debian/entrypoint @@ -4,7 +4,7 @@ interactive=$(if test -t 0; then echo true; else echo false; fi) set -eux -o pipefail ${EXTRA_SHELL_OPTS-} IFS=$'\n\t' -export JAVA_HOME=$(ls -d /usr/lib/jvm/*jdk* | tail -n 1) +export JAVA_HOME=$(find /usr/lib/jvm/ -maxdepth 1 -name "*jdk*" -type d) # Configure Java unlimited strength cryptography if [ "${CRYPTO_POLICY}" = "unlimited" ]; then