[Solved] I’m not getting any output and probably the machine hangs with the code [duplicate]
pro.waitFor(); is a blocking method. It will wait until the process has exited before returning. The problem with this is many programs will not exit until there standard out buffers have been read/cleared, meaning, in your case, it probably will never exit. Try something like this instead… import java.io.File; import java.io.IOException; import java.io.InputStream; public class … Read more