java: javac 9+ print their version to stdout not stderr

Fixes: #2569
pull/4488/head
Dylan Baker 6 years ago
parent 1d60a6a2ed
commit d405b74caf
  1. 2
      mesonbuild/environment.py

@ -803,8 +803,8 @@ class Environment:
p, out, err = Popen_safe(exelist + ['-version']) p, out, err = Popen_safe(exelist + ['-version'])
except OSError: except OSError:
raise EnvironmentException('Could not execute Java compiler "%s"' % ' '.join(exelist)) raise EnvironmentException('Could not execute Java compiler "%s"' % ' '.join(exelist))
version = search_version(err)
if 'javac' in out or 'javac' in err: if 'javac' in out or 'javac' in err:
version = search_version(err if 'javac' in err else out)
return JavaCompiler(exelist, version) return JavaCompiler(exelist, version)
raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"') raise EnvironmentException('Unknown compiler "' + ' '.join(exelist) + '"')

Loading…
Cancel
Save