From 33a3840d7bd8f298336433ac37913c0a340d5bd5 Mon Sep 17 00:00:00 2001 From: Andrew Obuchowicz Date: Mon, 20 Nov 2023 18:24:50 -0500 Subject: [PATCH] Create ~/.java/current/ symbolic links in /home/tooling/ instead of /home/user/ In order for stow in the UDI's entrypoint to complete successfully, any files present in /home/user/ (that are not in the .stow-local-ignore) must not also exist in /home/tooling/, otherwise a conflict would occur. Since the symbolic link creation from JAVA_HOME_8/11/17 occurs before stow is executed, the symbolic link must be created from JAVA_HOME_8/11/17 -> /home/tooling/ to prevent a stow conflict. Stow will then create a symbolic link from /home/tooling/.java/current/ -> /home/user/.java/current/ so that JAVA_HOME remains valid. Signed-off-by: Andrew Obuchowicz --- devspaces-udi/etc/entrypoint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devspaces-udi/etc/entrypoint.sh b/devspaces-udi/etc/entrypoint.sh index abbb66e378..1c7a392475 100755 --- a/devspaces-udi/etc/entrypoint.sh +++ b/devspaces-udi/etc/entrypoint.sh @@ -50,16 +50,16 @@ fi rm -rf "${HOME}"/.java/current mkdir -p "${HOME}"/.java/current if [ "${USE_JAVA8}" == "true" ] && [ ! -z "${JAVA_HOME_8}" ]; then - ln -s "${JAVA_HOME_8}"/* "${HOME}"/.java/current + ln -s "${JAVA_HOME_8}"/* /home/tooling/.java/current echo "Java environment set to ${JAVA_HOME_8}" elif [ "${USE_JAVA17}" == "true" ] && [ ! -z "${JAVA_HOME_17}" ]; then - ln -s "${JAVA_HOME_17}"/* "${HOME}"/.java/current + ln -s "${JAVA_HOME_17}"/* /home/tooling/.java/current echo "Java environment set to ${JAVA_HOME_17}" else # End of Support for OpenJDK 11 in October 2024 # https://access.redhat.com/articles/1299013 echo "TODO: it needs to set JDK 17 as default before OpenJDK 11 hits EOL in October 2024" - ln -s "${JAVA_HOME_11}"/* "${HOME}"/.java/current + ln -s "${JAVA_HOME_11}"/* /home/tooling/.java/current echo "Java environment set to ${JAVA_HOME_11}" fi