Skip to content

Commit

Permalink
fix: detect JAVA_HOME with Java 11 (#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
ltm committed Mar 17, 2022
1 parent 6d3ce21 commit 112f0a6
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 112f0a6

Please sign in to comment.