2013. 6. 11.

When creating process in java , If it does not worked.

check 1:
 - close all stream

    ProcessBuilder pb = new ProcessBuilder("app.exe");
    Process prs = pb.start();

   prs.getErrorStream.close();
   prs.getInputStream.close();
   prs.getOutputStream.close();
 

check2 :
  - check working directory or path
  - some application checks files in current directory.
  - parent working directory is different from sub application.

 
    ProcessBuilder pb = new ProcessBuilder("app.exe");
 
    pb.directory("location of app.exe");

    Process prs = pb.start();
    prs.getErrorStream.close();
   prs.getInputStream.close();
   prs.getOutputStream.close();




 

댓글 없음:

댓글 쓰기