【发布时间】:2013-11-21 01:19:30
【问题描述】:
我想创建一个 groovy 脚本来运行 grails clean、grails compile 和 grails run-app,但是,我注意到我无法运行任何 grails 命令。事实上,我尝试在 Groovy 控制台上运行以下脚本:
def envs = System.getenv().collect{"$it.key=$it.value"}
//println envs
println "java -version".execute(envs, new File("c:\\")).err.text
println "grails -version".execute(envs, new File("c:\\")).text
这本身给了我以下输出:
groovy> def envs = System.getenv().collect{"$it.key=$it.value"}
groovy> //println envs
groovy> println "java -version".execute(envs, new File("c:\\")).err.text
groovy> println "grails -version".execute(envs, new File("c:\\")).text
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)
Exception thrown
java.io.IOException: Cannot run program "grails" (in directory "c:\"): CreateProcess error=2, The system cannot find the file specified
at ConsoleScript26.run(ConsoleScript26:4)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
... 1 more
以前有人遇到过这个问题吗?
【问题讨论】: