From 6353fc789856055609eac2162095c67497d319cb Mon Sep 17 00:00:00 2001 From: Mesbah-Alam Date: Fri, 9 Jul 2021 10:05:51 -0400 Subject: [PATCH] Remove check that Java version output must start with "java version" Signed-off-by: Mesbah-Alam --- .../net/adoptopenjdk/stf/environment/JavaVersion.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/JavaVersion.java b/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/JavaVersion.java index 7eca9c3..0527d38 100644 --- a/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/JavaVersion.java +++ b/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/JavaVersion.java @@ -96,11 +96,6 @@ private JavaVersion(boolean isPrimaryJvm, String javaHome) throws StfException { if (javaVersionOutput.startsWith("openjdk version")) { javaVersionOutput = javaVersionOutput.replace("openjdk", "java"); } - - // Sanity check. Verify that the output appears correct - if (!javaVersionOutput.startsWith("java version")) { - throw new StfException("'Java -version' output does not start with 'java version'. Actual output was: " + javaVersionOutput); - } } public static JavaVersion getInstance(StfEnvironmentCore environmentCore) throws StfException { @@ -225,7 +220,7 @@ public boolean isJavaVersion(int version) { if (version == 9) { return isJava9(); } - return javaVersionOutput.trim().startsWith(brand + " version \"" + stringifiedVersion); + return javaVersionOutput.contains("version \"" + stringifiedVersion); } /**