Are you sure the process isn't waiting for input from an interactive (TTY-attached) STDIN stream?
Try sending ^D (CTRL+D), which should tell it that it's reached EOF. I don't know much about Java, only that it's weird and gross (so I have to assume writing to /dev/stderr or even /dev/console doesn't work as expected...) On Sat, 18 Dec 2021, 1:10 am Blake McBride, <bl...@mcbride.name> wrote: > Greetings, > > I have been calling groff from java for a long time. Works well. However, > recently I passed an errant file to groff through java and the process is > hanging. When run from the command line it works as expected. But when I > run it through java it hangs. I'm at a loss. Any help would sure be > appreciated. > > The Java code (Main.java): > > public class Main { > > public static void main(String [] argv) throws Exception { > ProcessBuilder builder = new ProcessBuilder("groff", "-mm", "-t", > "-Tpdf", "file.mm"); > Process p = builder.start(); > p.waitFor(); > System.out.println("Done."); > } > } > > > It hangs on the p.waitFor(). If I do a "ps lax |grep groff" I see groff is > still running (hung). > > I am attaching file.mm I know it is wrong, but it shouldn't cause a hang. > > Sure appreciate any help! > > Blake McBride >