Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit caa48c1

Browse files
committed
Fixes the javac version extraction issue
Fix #936. Regex to read javac version was not working for openjdk java version because it was expecting the output to starts with javac.
1 parent 01c4b6b commit caa48c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sysinfo.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ export class SysInfo implements ISysInfo {
7777
res.gradleVer = procOutput ? /Gradle (.*)/i.exec(procOutput)[1] : null;
7878

7979
let output = this.exec("javac -version", { showStderr: true });
80-
res.javacVersion = output ? /^javac (.*)/i.exec(output.stderr)[1]: null;
80+
// for other versions of java javac version output is not on first line
81+
// thus can't use ^ for starts with in regex
82+
res.javacVersion = output ? /javac (.*)/i.exec(output.stderr)[1]: null;
8183

8284
this.sysInfoCache = res;
8385
}

0 commit comments

Comments
 (0)