Skip to content

Commit

Permalink
fix: detect JAVA_HOME with Java 11 (apache#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebhsgit committed May 25, 2022
1 parent a718dc2 commit d592277
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/env/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d592277

Please sign in to comment.