This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Java Runtime.exec()


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]