more better jdk version detection
@@ -64,7 +64,9 @@ def fix_cmd(cmd):
out, err = p.communicate()
out, err = out.strip(), err.strip()
for prefix in ('javac 1.8', 'java version "1.8'):
- if (out or '').startswith(prefix) or (err or '').startswith(prefix):
+ for raw_out in ((out or ''), (err or '')):
+ for line in raw_out.split('\n'):
+ if line.startswith(prefix):
res = []
i = 0
while i < len(cmd):
