Skip to content

Commit 344e86f

Browse files
committed
Disable for RHEL 8
1 parent 5de699d commit 344e86f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/java/install.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,16 @@ if [ ! -d "${SDKMAN_DIR}" ]; then
303303
export SDKMAN_NATIVE_VERSION="false"
304304
fi
305305
curl -sSL "https://get.sdkman.io?rcupdate=false" | bash
306-
# For RHEL 8 systems, also disable native version in config file and remove native binaries
306+
# For RHEL 8 systems, also disable native CLI in config file and remove native binaries
307307
if [ "${ADJUSTED_ID}" = "rhel" ] && [ "${MAJOR_VERSION_ID}" = "8" ]; then
308-
# Disable native version in config to prevent future usage
308+
# Disable native CLI in config to prevent future usage
309+
# The SDKMAN config key is sdkman_native_enable (checked in sdkman-main.sh)
309310
if [ -f "${SDKMAN_DIR}/etc/config" ]; then
310-
sed -i 's/sdkman_native_version=.*/sdkman_native_version=false/' "${SDKMAN_DIR}/etc/config"
311+
if grep -q "sdkman_native_enable" "${SDKMAN_DIR}/etc/config"; then
312+
sed -i 's/sdkman_native_enable=.*/sdkman_native_enable=false/' "${SDKMAN_DIR}/etc/config"
313+
else
314+
echo "sdkman_native_enable=false" >> "${SDKMAN_DIR}/etc/config"
315+
fi
311316
fi
312317
# Remove native binaries if they were installed
313318
if [ -d "${SDKMAN_DIR}/libexec" ]; then

0 commit comments

Comments
 (0)