2 Replies Latest reply on Apr 25, 2008 7:41 AM by 807591

    execute shell script with cygwin


      I'v been reading this posting [http://forum.java.sun.com/thread.jspa?forumID=31&threadID=699276] about how to achieve running a bash script from a java application, but I didn't get it working. Currently my code is
      @Action(block = Task.BlockingScope.ACTION)
      public void executeTestGenerator() {
           File workDir = new File("c:/cygwin/bin");
              String[] cmdArray = new String[5];
           cmdArray[0] = "c:/cygwin/bin/bash";
              cmdArray[1] = "--login";
              cmdArray[2] = "-i";
              cmdArray[3] = "-c";
              cmdArray[4] = "/cygdrive/c/temp/dwhim";
           try {
                Runtime.getRuntime().exec(cmdArray, null, workDir);
                System.out.println("Executing cmd");
           } catch (IOException e) {
                // TODO Auto-generated catch block
      But nothing happens when I invoke this method. Has anybody an idea how to get this working?