Merge pull request #575 from stefanjudis/master

Fix for exception throwing Java version check
This commit is contained in:
Tobias Lidskog 2015-02-08 14:20:03 +01:00
commit f8091be041
1 changed files with 2 additions and 2 deletions

View File

@ -358,8 +358,8 @@ module.exports = {
if (err) {
return callback(err);
}
var matches = stderr.match(/java version "(.*)"/);
var version = matches.length === 2 ? matches[1] : 'unknown';
var matches = stderr.match(/(java version|openjdk version) "(.*)"/);
var version = (matches && matches.length === 3) ? matches[2] : 'unknown';
return callback(null, version);
});
}