Calling SCM via Java
![]()
Hey folks,
I'm writing a Java application to call the RTC scm command line client to login, create workspaces, and load data. I'm using the Java Process and ProcessBuilder classes for this. The issue I'm running into, is that I'm losing the error messages. Process
getInputStream(), along with a call to ProcessBuilder.redirectErrorStream(true).
|
One answer
![]()
Chris Ryan (157●3●24●28)
| answered Feb 26 '14, 11:52 a.m.
edited Feb 26 '14, 1:18 p.m. by sam detweiler (12.5k●6●189●201)
I found this page, so I now know what error code 25 means, but I'm still unsure how to get the appropriate error messages via Java.
http://stackoverflow.com/questions/14165517/processbuilder-forwarding-stdout-and-stderr-of-started-processes-without-blocki
Comments 1
the typical protocol for commandline applications is to generate good data on stdout (handle 1) and error info on stderr (handle 2)...
so if you are launching the app i java, you would need to capture the stderr output as well.
t turns out that I was not getting the output in the correct order. i.e. I was calling process.waitFor() before reading my stream.
that will do it!.. thanks for posting back |