From 6f13dbb27bb3c97dab91062f414cf2451205a959 Mon Sep 17 00:00:00 2001 From: Vanessa Rene Valderrama Date: Wed, 20 Mar 2019 15:15:27 -0500 Subject: [PATCH] Fix JAVA_HOME for CentOS7 JAVA_HOME for JDK-11 on CentOS7 is set to /opt/jdk-11 but JDK-11 is installing in /usr/lib/jvm/java-11-openjdk/. This change is to modify JAVA_HOME to use the correct path and install JDK-11 properly. Change-Id: I598a063988a5afea5d6827d0940fdcbd2b83e99a Signed-off-by: Vanessa Rene Valderrama --- releasenotes/notes/fix_openjdk-11_centos7.yaml | 5 +++++ shell/update-java-alternatives.sh | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix_openjdk-11_centos7.yaml diff --git a/releasenotes/notes/fix_openjdk-11_centos7.yaml b/releasenotes/notes/fix_openjdk-11_centos7.yaml new file mode 100644 index 00000000..8e050145 --- /dev/null +++ b/releasenotes/notes/fix_openjdk-11_centos7.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix JAVA_HOME for openjdk11 on CentOS 7 to use the OpenJDK version installed + in /usr/lib/jvm/java-11-openjdk. diff --git a/shell/update-java-alternatives.sh b/shell/update-java-alternatives.sh index f85e2018..8484a711 100644 --- a/shell/update-java-alternatives.sh +++ b/shell/update-java-alternatives.sh @@ -16,9 +16,7 @@ JAVA_ENV_FILE="/tmp/java.env" update-java-redhat() { if [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "11" ]]; then - export JAVA_HOME="/opt/jdk-11" - elif [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "10" ]]; then - export JAVA_HOME="/opt/jdk-10.0.2" + export JAVA_HOME="/usr/lib/jvm/java-11-openjdk" else export JAVA_HOME="/usr/lib/jvm/java-1.${SET_JDK_VERSION//[a-zA-Z:-]/}.0-openjdk" fi -- 2.16.6