Hi,
Im trying to execute a perl script with parameters from my java code. given below is the first few lines.
try { p = Runtime.getRuntime().exec("perl E:\\tools\\Rouge1551\\ROUGE-1.5.5.pl -n 4 -w 1.2 -m -2 4 -u -c 95 -r 1000 -f A -p 0.5 -t 0 -a E:/tools/Rouge1551/rougejk_A1.in"); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); String line=""; while ((line = input.readLine()) != null) { System.out.println(line); } p.waitFor(); } catch(Exception e) { System.out.println("Exception: "+ e.toString()); } finally { if (p != null) { close(p.getInputStream()); close(p.getErrorStream()); close(p.getOutputStream()); p.destroy();} }
The program does not print anything, since p.getInputStream returns null. The command works when i run in command prompt.
please help.
thanks
jessie