I plan to write a website frontend for a free computer algebra system (Reduce, http://reduce-algebra.com/). On the webserver I have a Java virtual machine running, and Reduce is also installed.
I can start the application via exec() in the Java file. But my question is the following: how can I emulate user inputs and how can I retrieve the outputs of the program? The main issue is that I want to log the whole session, not just call the program once, get the output, close it, and restart it again.
I need a way that allows for interactive communication, i.e. a way to "paste" a command in the command line, and a way to "copy" the response back to the Java program.