You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by no...@apache.org on 2022/03/17 23:38:12 UTC

[cordova-android] branch master updated: fix: detect JAVA_HOME with Java 11 (#1406)

This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new 112f0a6  fix: detect JAVA_HOME with Java 11 (#1406)
112f0a6 is described below

commit 112f0a61a855b39eba35841703f40a7244d0a395
Author: Lars Mikkelsen <la...@ionic.io>
AuthorDate: Thu Mar 17 19:38:04 2022 -0400

    fix: detect JAVA_HOME with Java 11 (#1406)
---
 lib/env/java.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/env/java.js b/lib/env/java.js
index 2a0c39d..5bd75cb 100644
--- a/lib/env/java.js
+++ b/lib/env/java.js
@@ -99,7 +99,8 @@ const java = {
                 } else {
                     // See if we can derive it from javac's location.
                     var maybeJavaHome = path.dirname(path.dirname(javacPath));
-                    if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) {
+                    if (fs.existsSync(path.join(maybeJavaHome, 'bin', 'java')) ||
+                            fs.existsSync(path.join(maybeJavaHome, 'bin', 'java.exe'))) {
                         environment.JAVA_HOME = maybeJavaHome;
                     } else {
                         throw new CordovaError(default_java_error_msg);

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org