I have a problem in my code
ProcessBuilder pb = new ProcessBuilder("my program.exe","-g");
Process core = pb.start();
if(!core.waitFor(5, TimeUnit.HOURS))
{
isDestroyed = true;
core.destroy();
}
else
isDestroyed = false;
String xmlOutput = IOUtils.toString(core.getInputStream());
And the problem is that it works all the time exactly 5 hours, but when I run it from console, it works <10 seconds. What's the problem? OS is Windows 8.1 64bit.
I want it runs the same time as from console. Or there is another good way to get output? If yes, please say how. Thanks