This is essentially what I'm doing:
ProcessBuilder pb = new ProcessBuilder("./myProgram","myArguments");
pb.redirectInput(new File("myFile.txt"));
try
{
Process p = pb.start();
}
catch (Exception e)
{
...
}
I'm using JDK 8 at home and this code snippet works just fine. However, this is part of a school assignment and unfortunately the school is running JDK 6, so methods like redirectInput() don't exist in the ProcessBuilder class.
Is there any way I'd be able to redirect input the same way that redirectInput() does? I've been searching various solutions that people with similar problems were offered but have yet to find a working one.
Thanks!