diff --git a/bin/templates/cordova/lib/check_reqs.js b/bin/templates/cordova/lib/check_reqs.js index 473d1e106..39591dfb9 100644 --- a/bin/templates/cordova/lib/check_reqs.js +++ b/bin/templates/cordova/lib/check_reqs.js @@ -195,9 +195,10 @@ module.exports.check_java = function () { } }).then(function () { return Q.denodeify(child_process.exec)('javac -version') - .then(([stdout, stderr]) => { + .then(outputs => { + // outputs contains two entries: stdout and stderr // Java <= 8 writes version info to stderr, Java >= 9 to stdout - const output = (stdout + stderr).trim(); + const output = outputs.join('').trim(); const match = /javac\s+(\d+\.\d+)/i.exec(output); return match && match[1] === '1.8'; }, () => {