How can I get the correct exit code from LSCM when calling from Java?
HI. . . I recently started using the Java runTime rather than ant to run lscm commands. Unfortunately, I can't seem to get the true exit value. It seems there are a ton of variables to this simple topic including how the java interpreter is called from the batch file, how the batch file exits, whether command extensions are used in the Windows command interpreter, and whether ProcessBuilder or runTime.exec() is used. There may even be more that I'm not aware of.
If I run the lscm command from the console and run "echo %ERRORLEVEL%", it looks accurate. But I haven't been able to get this exit value from my java code, it just returns 0 regardless of the success of the command.
Does anyone have a tried and true approach to calling lscm from Java and getting accurate exit values?
Thanks for your thoughts and help!
- Andy