mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-23 01:19:38 +08:00
fix: detect JAVA_HOME with Java 11 (#1406)
This commit is contained in:
parent
6d3ce211dd
commit
112f0a61a8
3
lib/env/java.js
vendored
3
lib/env/java.js
vendored
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user