Skip to content

Commit

Permalink
Remove check that Java version output must start with "java version" (#…
Browse files Browse the repository at this point in the history
…118)

Signed-off-by: Mesbah-Alam <[email protected]>
  • Loading branch information
Mesbah-Alam authored Jul 9, 2021
1 parent 6abbb82 commit 2129b19
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 2129b19

Please sign in to comment.