Set Java 11 as default version for onap worker 58/16758/1
authornauman <nauman.yaseen@est.tech>
Wed, 18 Jan 2023 17:06:13 +0000 (17:06 +0000)
committernauman <nauman.yaseen@est.tech>
Wed, 18 Jan 2023 17:06:13 +0000 (17:06 +0000)
Change-Id: Icf490345e0d7fbc852ab7a665ca60d578fd3e9c4

infra/jenkins/slave-setup/nordix-onap-jenkins-build-server/configure-image.sh

index d3b6f999eea74ed13b38e901428b372182729dda..fbcf1dcf0d2ba20746c3c83d666089cdefc89517 100644 (file)
@@ -95,14 +95,13 @@ sudo -H -E apt autoremove -y
 
 echo "Info  : Install additional Java version"
 # INSTALL additional Java 11 and 12 while keep pointing alternatives to JDK8
-sudo cp -R /etc/alternatives /etc/keep-alternatives
 sudo add-apt-repository -y ppa:openjdk-r/ppa
 sudo apt-get update
 sudo -H -E apt -y -q=3 install \
     openjdk-11-jdk \
     openjdk-12-jdk
-sudo rm -rf /etc/alternatives
-sudo mv /etc/keep-alternatives /etc/alternatives
+# set java 11 as default version
+sudo update-java-alternatives -s java-1.11.0-openjdk-amd64
 java -version
 
 echo "Info  : Enable time sync"