mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-24 01:52:54 +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 {
|
} else {
|
||||||
// See if we can derive it from javac's location.
|
// See if we can derive it from javac's location.
|
||||||
var maybeJavaHome = path.dirname(path.dirname(javacPath));
|
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;
|
environment.JAVA_HOME = maybeJavaHome;
|
||||||
} else {
|
} else {
|
||||||
throw new CordovaError(default_java_error_msg);
|
throw new CordovaError(default_java_error_msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user