/**
* Initialize local version from asadmin command
*/
protected void initLocalVersions() {
CommandResult commandResult = SystemCommandExecutor.execute(Arrays.asList(standaloneCommand, "--version"));
// Tbe return code here is always 1
if (commandResult.getExitCode() == 1) {
String output = commandResult.getResult();
Matcher versionMatcher = PATTERN_VERSION_LOCAL.matcher(output);
// Get the last match
while (versionMatcher.find()) {
localVersion = versionMatcher.group(1);
}
CommandResult jdkVersionCommand = SystemCommandExecutor.execute(Arrays.asList(adminCommand, "version"));
if (jdkVersionCommand.isOk()) {
String adminOutput = jdkVersionCommand.getResult();
Matcher jdkVersionMatcher = PATTERN_JDK_VERSION_LOCAL.matcher(adminOutput);
if (jdkVersionMatcher.find()) {
localJdkVersion = jdkVersionMatcher.group(1);
}
} else {
logger.log(Level.SEVERE, "Could not initialize local version information from admin command: {0}: {1}", new Object[]{jdkVersionCommand.getResult(), jdkVersionCommand.getThrowable()});
}
} else {
logger.log(Level.SEVERE, "Could not initialize local version information from admin command: {0}: {1}", new Object[]{commandResult.getResult(), commandResult.getThrowable()});
}
}