mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
CB-7634 Detect JAVA_HOME properly on Ubuntu
This commit is contained in:
parent
1c3f7e6f93
commit
c2bba3f5e3
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user