在构建插件时,Grails Run-App导致IOException无法找到文件'grails'

时间:2013-10-02 16:28:56

标签: java windows grails path javac

我试图从命令行在Windows 7(x64)上运行grails应用程序和插件。我可以在没有插件的情况下运行应用程序,但是当我将插件添加到项目中时,我得到一个带有消息Cannot run program "grails" (in directory "[plugin directory]"): CreateProcess error=2, The system cannot find the file specified的java.io.IOException。 grails / bin文件夹位于我的系统环境路径变量中,并且从插件目录的命令行运行就好了。就好像java环境有自己的路径变量,不包含grails。有什么想法吗?

我已经在下面列出了应用程序的完整输出,并修改了插件项目的路径。我希望今天下午能够向客户演示这个项目,因此非常感谢快速的帮助。

| Loading Grails 2.2.1
| Compiling 3 source files.....
| Compiling 3 source files.....
| Error Error executing script RunApp: : Execute failed: java.io.IOException: Cannot run program "grails" (in directory "[plugin directory]"): CreateProcess error=2, The system cannot find the file specified (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
: Execute failed: java.io.IOException: Cannot run program "grails" (in directory "[plugin directory]"): CreateProcess error=2, The syst
em cannot find the file specified
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:675)
        at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99)
        at _Events$_run_closure2.doCall(_Events.groovy:35)
        at _Events$_run_closure2.doCall(_Events.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at _Events$_run_closure3.doCall(_Events.groovy:54)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.apache.tools.ant.BuildListener$targetStarted.call(Unknown Source)
        at org.codehaus.gant.GantBinding$_withTargetEvent_closure1.doCall(GantBinding.groovy:89)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:89)
        at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
        at RunApp$_run_closure1.doCall(RunApp.groovy:35)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
        at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at gant.Gant.withBuildListeners(Gant.groovy:427)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:415)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.executeTargets(Gant.groovy:591)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at gant.Gant.executeTargets(Gant.groovy:590)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
Caused by: java.io.IOException: Cannot run program "grails" (in directory "[plugin directory]"): CreateProcess error=2, The system cann
ot find the file specified
        at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
        at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
        at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
        at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
        at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
        ... 53 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        ... 58 more
| Error Error executing script RunApp: : Execute failed: java.io.IOException: Cannot run program "grails" (in directory "[plugin directory]"): CreateProcess error=2, The system cannot find the file specified

0 个答案:

没有答案