I'm designing an interface to AMPL, a mathematical programming language, in java. I'm trying out the runtime.exec but I need to feed an input file to ampl as well as numerous commands and get the results. I've been trying everything that comes to my mind but all I get is a complaint "bad input block". Does anyone have an idea about how to solve this problem? I would really appreciate help. Thanks, merci