Feat: Add support for OpenJDK17
[releng/global-jjb.git] / shell / update-java-alternatives.sh
index 69bf019..39f4699 100644 (file)
@@ -8,7 +8,7 @@
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
-
+echo "---> update-java-alternatives.sh"
 # This script takes the java-version variable to set the proper alternative
 # for java, javac and java_sdk_openjdk for ubuntu or centos/fedora/redhat distros
 
@@ -17,6 +17,10 @@ JAVA_ENV_FILE="/tmp/java.env"
 update-java-redhat() {
     if [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "11" ]]; then
         export JAVA_HOME="/usr/lib/jvm/java-11-openjdk"
+    elif [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "12" ]]; then
+        export JAVA_HOME="/usr/lib/jvm/java-12-openjdk"
+    elif [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "17" ]]; then
+        export JAVA_HOME="/usr/lib/jvm/java-17-openjdk"
     else
         export JAVA_HOME="/usr/lib/jvm/java-1.${SET_JDK_VERSION//[a-zA-Z:-]/}.0-openjdk"
     fi