Skip to content

Commit

Permalink
Create ~/.java/current/ symbolic links in /home/tooling/ instead of /…
Browse files Browse the repository at this point in the history
…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 <aobuchow@redhat.com>
  • Loading branch information
AObuchow committed Nov 20, 2023
1 parent 82cfdbf commit 33a3840
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions devspaces-udi/etc/entrypoint.sh
Expand Up @@ -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

Expand Down

0 comments on commit 33a3840

Please sign in to comment.