I ran a
test on this as follows.
import java.io.*;
public class run{
public static void main(String args[])
{
try
{
String writeLine = "Testing";
System.out.println(writeLine);
File writeFile =
new File("c:\\java","test.txt");
DataOutputStream dataFile =
new DataOutputStream(new BufferedOutputStream(new
FileOutputStream(writeFile)));
dataFile.write((writeLine.getBytes()));
dataFile.close();
}
catch(IOException ioe)
{System.out.println("Exception : " + ioe);}
}
}
public class runtest
{
public static void main(String [] qq)
{
System.out.println("in the main");
try{
Runtime r;
r = Runtime.getRuntime();
r.exec("java run");
}catch(Exception e){System.out.println("caught");}
System.out.println("out of the main");}
}
And while the System.out.println doesn't display to the console, the file test.txt is created. Therefore I assume that the program did run but, the output is directed to a stream that you can't see. If you need the output from filename to be displayed, you could save it in a file and read it in the original program.