Skip to content

why java version is got from stderr? #3148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
intellild opened this issue Oct 8, 2017 · 2 comments
Closed

why java version is got from stderr? #3148

intellild opened this issue Oct 8, 2017 · 2 comments
Assignees

Comments

@intellild
Copy link

cli 3.2.1

I found this line of code

this.javaCompilerVerCache = output ? /javac (.*)/i.exec(output.stderr)[1] : null;

while stderr is empty and stdout is "Java 9\r\n", I tried changing "stderr" to "stdout" and it works with correct java version. Then in function 'validateJavacVersion', the 'installedJavaVersion' is receives a correct number '9'.

But this line of code return nothing

const matchingVersion = (installedJavaVersion || "").match(AndroidToolsInfo.VERSION_REGEX);

and endup with

Error executing command 'javac'. Make sure you have installed The Java Development Kit (JDK) and set JAVA_HOME environment variable.

@etabakov
Copy link
Contributor

Hey @hzjzx. Regarding your first comment about using stdout instead of stderr - looks like a valid observation to me. Feel free to submit a PR and the team will review it.

Regarding the second problem - I will check and let you know, what might be the reason.

@dtopuzov
Copy link
Contributor

Closing, explanation posted in related PR telerik/mobile-cli-lib#1017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants