Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove check that Java version output must start with "java version" #118

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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