Verify that tests are run with the expected JRE version (#11835)

Change-Id: I77b48cc646776a452204e2c93954fdd1eea7e4de