mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
The JDK doesn't put `javac` in the PATH on Windows :(
This commit is contained in:
parent
a002e72022
commit
718859ad8d
@ -70,11 +70,14 @@ class AndroidWorkflow extends DoctorValidator implements Workflow {
|
|||||||
String javaVersion;
|
String javaVersion;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
printTrace('javac -version');
|
printTrace('java -version');
|
||||||
|
|
||||||
ProcessResult result = processManager.runSync(<String>['javac', '-version']);
|
ProcessResult result = processManager.runSync(<String>['java', '-version']);
|
||||||
if (result.exitCode == 0)
|
if (result.exitCode == 0) {
|
||||||
javaVersion = result.stderr.split('\n')[0];
|
javaVersion = result.stderr;
|
||||||
|
List<String> versionLines = javaVersion.split('\n');
|
||||||
|
javaVersion = versionLines.length >= 2 ? versionLines[1] : versionLines[0];
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +86,7 @@ class AndroidWorkflow extends DoctorValidator implements Workflow {
|
|||||||
'No Java Development Kit (JDK) found; you can download the JDK from $_kJdkDownload.'
|
'No Java Development Kit (JDK) found; you can download the JDK from $_kJdkDownload.'
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
messages.add(new ValidationMessage('Java Development Kit (JDK) found: $javaVersion'));
|
messages.add(new ValidationMessage(javaVersion));
|
||||||
type = ValidationType.installed;
|
type = ValidationType.installed;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user