diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js index 40f3ade3..af619385 100644 --- a/bin/lib/check_reqs.js +++ b/bin/lib/check_reqs.js @@ -100,7 +100,8 @@ module.exports.check_java = function() { }); } else { // See if we can derive it from javac's location. - var maybeJavaHome = path.dirname(path.dirname(javacPath)); + // fs.realpathSync is require on Ubuntu, which symplinks from /usr/bin -> JDK + var maybeJavaHome = path.dirname(path.dirname(fs.realpathSync(javacPath))); if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) { process.env['JAVA_HOME'] = maybeJavaHome; } else {