Runtime.getRuntime().exec(java test)
843798Jul 23 2001 — edited Jul 24 2001Hi,
As part of a thesis for college, I am trying to execute a test java program. The program executes okay and I can read the results okay.
Sample code.
process = Runtime.getRuntime().exec("java test");
InputStream iOutStream = process.getInputStream();
InputStream ErrorStream = process.getErrorStream();
However, I need to be able to execute a progam that reads a parameter from the screen. I tried to pass a parameter file but it doesn't work.
process = Runtime.getRuntime().exec("java test <input.txt");
I also tried just passing the parameters as a string array but it doesn't work either.
process = Runtime.getRuntime().exec("java test 2, 2");
Is there any other way that I can get the process to accept parameters?
My deadline is looming so any help would be greatly appreciated.
Thanks
Eleanor
eleanmck@gofree.indigo.ie