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); } /**