Commit 718859ad authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Partially revert #8332 (#8386)

The JDK doesn't put `javac` in the PATH on Windows :(
parent a002e720
......@@ -70,11 +70,14 @@ class AndroidWorkflow extends DoctorValidator implements Workflow {
String javaVersion;
try {
printTrace('javac -version');
printTrace('java -version');
ProcessResult result = processManager.runSync(<String>['javac', '-version']);
if (result.exitCode == 0)
javaVersion = result.stderr.split('\n')[0];
ProcessResult result = processManager.runSync(<String>['java', '-version']);
if (result.exitCode == 0) {
javaVersion = result.stderr;
List<String> versionLines = javaVersion.split('\n');
javaVersion = versionLines.length >= 2 ? versionLines[1] : versionLines[0];
}
} 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.'
));
} else {
messages.add(new ValidationMessage('Java Development Kit (JDK) found: $javaVersion'));
messages.add(new ValidationMessage(javaVersion));
type = ValidationType.installed;
}
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment