From c2bba3f5e36c5b91bb6da4d943efe18df633fb6d Mon Sep 17 00:00:00 2001 From: Andrew Grieve Date: Mon, 29 Sep 2014 10:15:37 -0400 Subject: [PATCH] CB-7634 Detect JAVA_HOME properly on Ubuntu --- bin/lib/check_reqs.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {