Adding utility to set cell machines to OpenJDK 11.

Change-Id: Ie6addd459bf68f1158199a8682acc4d620d2b4c1
diff --git a/tools/test/bin/stc-set-openjdk11 b/tools/test/bin/stc-set-openjdk11
new file mode 100755
index 0000000..47f70cf
--- /dev/null
+++ b/tools/test/bin/stc-set-openjdk11
@@ -0,0 +1,14 @@
+#!/bin/bash
+#-------------------------------------------------------------------------------
+# Utility to set OpenJDK 11 as a default on all cell machines.
+#-------------------------------------------------------------------------------
+
+nodes="${1:-$OCN $ONOS_INSTANCES $ONOS_CORES}"
+
+for node in $nodes; do
+    echo $node:
+    ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no ${ONOS_USER}@$node "
+        sudo update-java-alternatives -s java-1.11.0-openjdk-amd64
+        echo 'export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64' > .bash_aliases
+    "
+done
diff --git a/tools/test/scenarios/prerequisites.xml b/tools/test/scenarios/prerequisites.xml
index 907ffff..6d56bfe 100644
--- a/tools/test/scenarios/prerequisites.xml
+++ b/tools/test/scenarios/prerequisites.xml
@@ -18,6 +18,7 @@
         <step name="Check-Environment"
               exec="test -n ${ONOS_ROOT} -a -n ${ONOS_NIC} -a -n ${OC1}"/>
         <step name="Check-ONOS-Bits" exec="onos-check-bits"/>
+        <step name="Set-OpenJDK-11-As-Default" if="${stcOpenJDK}" exec="stc-set-openjdk11"/>
         <parallel var="${OC#}">
             <step name="Check-Passwordless-Login-${#}"
                   exec="ssh -n -o ConnectTimeout=3 -o PasswordAuthentication=no ${ONOS_USER}@${OC#} date"/>