telerik / mobile-cli-lib

Contains common infrastructure for CLIs - mainly AppBuilder, NativeScript, DDB and Proton.
Apache License 2.0
11 stars 10 forks source link

Fix detection of Javac version #1037

Closed rosen-vladimirov closed 6 years ago

rosen-vladimirov commented 6 years ago

The command javac -version prints result to stderr when JAVA 8 is used and to stdout when JAVA 9 is used. Current check in CLI uses the stderr output, so when JAVA 9 is installed it fails to detect the correct version. In order to support both JAVA 8 and JAVA 9, capture both stdout and stderr and get the version from there. Also remove unneeded check for Java version - we care about JAVA Compiler, which is included in JDK.