Java Runtime.exec()

SAWANT, SACHIN (Non-HP-PaloAlto, ex1) sachin_sawant@non.hp.com
Mon Jul 9 18:03:00 GMT 2001


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/


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /