anchor.diff:          'Ensure Java is installed and available on your path.');
       print(javaResult.stderr);
     }
  -  final String javaVersionStdout = javaResult.stdout;
  -  if (javaVersionStdout.contains('"1.8')) {
  +  // `java -version` writes to stderr.
  +  final String javaVersionStdout = javaResult.stderr;
  +  if (!javaVersionStdout.contains('"1.8')) {
       print('The Android SDK tools may not work properly with your Java version. '
           'If this process fails, please retry using Java 1.8.');
     }
  
positive.code:   return argParser;
  }
  
  /// Checks that `java` points to Java 1.8.
  ///
  /// The SDK lint tool may not work with Java > 1.8.
  Future<void> checkJava1_8() async {
    print('Checking Java version...');
    final ProcessResult javaResult = await processManager.run(
      <String>['java', '-version'],
    );
  
negative.code:   if (argResults['html']) {
      lintArgs.addAll(<String>['--html', argResults['out']]);
    }
    final String javaHome = await getJavaHome();
    final Process lintProcess = await processManager.start(
      lintArgs,
      environment: javaHome != null
          ? <String, String>{
              'JAVA_HOME': javaHome,
            }
          : null,
    );
    lintProcess.stdout.pipe(stdout);
    lintProcess.stderr.pipe(stderr);
    return await lintProcess.exitCode;
  