You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/09/29 16:17:09 UTC

[2/5] android commit: CB-7634 Detect JAVA_HOME properly on Ubuntu

CB-7634 Detect JAVA_HOME properly on Ubuntu


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/e31c911c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/e31c911c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/e31c911c

Branch: refs/heads/4.0.x
Commit: e31c911c3056f06ed936a40c27f5723d97ed4692
Parents: a658ea1
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 29 10:15:37 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 29 10:16:22 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/e31c911c/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index a7410e9..e527571 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -101,7 +101,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 {