Fix JAVA_HOME for CentOS7 85/14985/4
authorVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Wed, 20 Mar 2019 20:15:27 +0000 (15:15 -0500)
committerVanessa Rene Valderrama <vvalderrama@linuxfoundation.org>
Thu, 21 Mar 2019 18:05:19 +0000 (13:05 -0500)
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 <vvalderrama@linuxfoundation.org>
releasenotes/notes/fix_openjdk-11_centos7.yaml [new file with mode: 0644]
shell/update-java-alternatives.sh

diff --git a/releasenotes/notes/fix_openjdk-11_centos7.yaml b/releasenotes/notes/fix_openjdk-11_centos7.yaml
new file mode 100644 (file)
index 0000000..8e05014
--- /dev/null
@@ -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.
index f85e201..8484a71 100644 (file)
@@ -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