Communicate with C program using stdin/out from Java
问题 I want my Java program to communicate with a C program. This is just a simple example but I can't get it working. The Java program is supposed to run the C program and write to its input stream. The C program should see this and write to stdout in response. Finally, the Java program should read this response from the C program's stdout and print it to the screen. Running the C program from command line I get the desired behaviour. However, when ran from the Java program, it just "hangs" and