title: Unable to run Groovy commands with ProcessBuilder in java
body: <pre><code>Following is my code. I am trying to run groovy command using processBuilder in some other directory. this code is not working for groovy command but same works for java command. 
  
  
  String[] str1 = {"groovy","-version"};
      File directory = new File(directory_name).getAbsoluteFile();
  
               System.setProperty("user.dir", directory.getAbsolutePath());
  
               ProcessBuilder processBuilder = new ProcessBuilder(str1);
               processBuilder.directory(directory);
               Process process = processBuilder.start();
  </code></pre>
  
  <p>It is throwing Internal Server error with below error logs:
  by looking on these logs it seems like that groovy command can not be run on particular directory, so i checked that one as well through command prompt and found that groovy command is working fine.</p>
  
  <pre><code>java.io.IOException: Cannot run program "groovy" (in directory "C:\Users\anurag.malik.NUCDOMAIN\Desktop\Work\24-04-2017_WarDiff"): CreateProcess error=2, The system cannot find the file specified
      java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
      com.yolo.controllers.fileUploadController.uploadFile(fileUploadController.java:72)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:601)
      org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)
      org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
      org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
      org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
      org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
      org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  </code></pre>