Currently, I have this simple code that executes java -version to the command line to check if the user has installed Java.
Odd, that when I run this code, stdout gives me nothing, but stderr gives me my desired result.
cprocess.execSync("java -version", (err, stdout, stderr) => {
console.log("stdout: " + stdout); // nothing
console.log("stderr: " + stderr); // output: java version
}
Why is this happening? Do I need to change anything in exec options?