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:12 UTC
[5/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/c2bba3f5
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/c2bba3f5
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/c2bba3f5
Branch: refs/heads/3.6.x
Commit: c2bba3f5e36c5b91bb6da4d943efe18df633fb6d
Parents: 1c3f7e6
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:52 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/c2bba3f5/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 40f3ade..af61938 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 {