Specify JDK as openjdk-bin-11 upon entering chroot

BUG=chromium:1105515
BUG=b:160661271
TEST=// This test should be done when multiple version of JDK exist.
// Currently, there is only JDK 11 in chroot.
// Please refer to crrev.com/c/2336338 to set up the environment to perform
// the tests below.
// This CL should be merged first because default selection of JDK 11
// should be established before having multiple versions of JDK.
// Also tested on current environment where only JDK 11 exist.

sudo eselect java-vm set system icedtea-bin-8
// Initially set default JDK as JDK8
// Make sure /etc/cros_chroot_version is 179.

sudo eselect java-vm list
// Confirm that the system-vm is currently icedtea-bin-8.

run_chroot_version_hooks
// Make sure run_chroot_version_hooks is now 180.

sudo eselect java-vm list
// Confirm that the system-vm is now openjdk-bin-11.

Change-Id: Ib21cb70672e48eaf519c99f7d74951a17dd94adb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/2335921
Tested-by: Jiyoun Ha <jiyounha@chromium.org>
Commit-Queue: Jiyoun Ha <jiyounha@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Jiyoun Ha <jiyounha@chromium.org>
2 files changed