This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Java Runtime.exec()
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Subject: Java Runtime.exec()
- From: "SAWANT,SACHIN (Non-HP-PaloAlto,ex1)" <sachin_sawant at non dot hp dot com>
- Date: Mon, 9 Jul 2001 18:03:02 -0700
Hi,
We are using cygwin to run our application. I am trying to execute a shell
file at the operation system through java. The code is as follows
String unixCommand = "./run.sh";
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("unixCommand");
InputStream result = proc.getInputStream();
InputStreamReader isr = new InputStreamReader(result);
BufferedReader br = new BufferedReader(isr);
String line = null;
while ( (line = br.readLine()) != null)
out.println(line);
int exitVal = proc.waitFor();
I am getting CreateProcess Exception when I try to run this code. It does
work well for other unix commands like "ls" or "ps". Am I doing something
wrong?
Regards
Sachin
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/