- Where Developers Learn, Share, & Build Careers


I am trying to use msys.bat in ProcessBuilder in java. When I run a .bat file with my program, the following error occurred: "rxvt.exe or sh.exe binary - can not be canceled." Press any key to continue ... "

Here is the code,

  processbilder MSIS = new processbilder ("C: / MMSIS / 1 / MMS.Bit", "/ c", "find" c: / user / dan g / Desktop / hello \ ""); Process p = Msys.start (); String line; BufferedReader r = new BufferedReader (new InputStreamReader (p.getInputStream ())); While ((line = r. radline ()) = null {}. System.out.println (line); } R. Close ();   

The goal is to compile some of my projects. The command is just a test for a result, not what I want to do.

Thanks for the help!

.bat files are their own and those called Windows Command Processors, cmd before your bat file Do not forget to load the Windows Command Processor also .exe

  processbilder MSIS = new process builder ("CMD.exe", "c: / mmsis / 1.0.0 /msys.bat", "/ c", "find \" c: / user / Dan G / Desktop / Hello. F "");   

Edit
See this helpful article for tips and tricks that come with this process:. The code in the article is a little date, but the concepts were done in the form of the world as of today, as they were then. This is highly recommended.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -