I am writing code to use the Win32 API to determine the version of Java. For instance.
Basically, I follow MSDN Creating a child process with redirected inputs and outputs https://msdn.microsoft.com/en-us/library/ms682499%28VS.85%29.aspx
string GetJavaVersion(string sJavaExePath) { }
This is the pseudo client code:
ASSERT(GetJavaVersion("C:\Program Files (x86)\Java\jdk1.7.0_17\bin\java.exe") == "1.7.0_25");
I can get the result as:
java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b17) Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode, sharing)
However, the result is sent back from stdErr, although I have to return from stdOut.
Does it make sense to get a string from stdErr?
source share