Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html" rel="nofollow">Runtime</a> class to run Cygwin. This is very brittle, and dependent upon your setup, but on my machine I would do: </p> <pre><code>Runtime r = Runtime.getRuntime(); Process p = r.exec("C:\\dev\\cygwin\\bin\\mintty.exe --exec /cygpath/to/foo.sh"); </code></pre> <p>Then wait for the <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Process.html" rel="nofollow">Process</a> to complete, and get a handle to it's InputStream objects to see what was sent to stdout and stderror. </p> <p>The first part of the command is to run cygwin, and the second is to execute some script, or command (using <code>-e</code> or <code>--exec</code>). I would test this command on the DOS prompt to see if it works first before cutting any code. Also, take a look at the options available by doing:</p> <pre><code>C:\dev\cygwin\bin\mintty.exe --help </code></pre> <p>Also from within the DOS prompt.</p> <p>EDIT: The following works for me to print version information</p> <pre> <code> public class RuntimeFun { public static void main(String[] args) throws Exception { Runtime r = Runtime.getRuntime(); Process p = r.exec("C:\\dev\\cygwin\\bin\\mintty.exe --version"); p.waitFor(); BufferedReader buf = new BufferedReader( new InputStreamReader( p.getInputStream())); String line = buf.readLine(); while (line != null) { System.out.println(line); line = buf.readLine(); } } } </code> </pre> <p>Unfortunately, can't seem to get it working with <code>--exec</code>, so you're going to have to do some more research there.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload