0

String で Groovy の execue() 関数を使用しようとしています

String command = "groovy -e \"print \'Groovy\'\""
println command
println command.execute().text

私はこの出力を受け取ります:

groovy -e "print 'Groovy'"
Caught: java.io.IOException: Cannot run program "groovy": CreateProcess error=2,
 The system cannot find the file specified
java.io.IOException: Cannot run program "groovy": CreateProcess error=2, The sys
tem cannot find the file specified
        at ProcessParameters.run(ProcessParameters.groovy:6)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
        ... 1 more

コマンドラインから実行しますが、 groovy SimpleExample.groovy を実行してコードを実行します。

これは、cmd ターミナルを介して Windows 7 マシン上にあります。Groovy バージョン 2.1.8 JVM: 1.7.0_04

4

0 に答える 0