I've checked many threads about running external programs but they cant solve my problem. for running Siesta (DFT Calculation) I have to use something like this (Si.fdf is the input file): siesta < Si.fdf I'm using this code:
public static void main(String argv[]) throws IOException {
Runtime r = Runtime.getRuntime();
Process p;
BufferedReader is;
String line;
System.out.println("siesta < Si.fdf");
p = r.exec("siesta < Si.fdf");
System.out.println("In Main after exec");
is = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = is.readLine()) != null)
System.out.println(line);
System.out.println("In Main after EOF");
System.out.flush();
try {
p.waitFor();
} catch (InterruptedException e) {
System.err.println(e); //
return;
}
System.err.println("Process done, exit status was " + p.exitValue());
return;
}
but this code only runs Siesta without any input file.