![]() | errors in 'groovy -v'.execute().text |
|
04 Jul 2008, 21:43
Rajagopalan Raghavan (5 posts) |
groovy> println ‘groovy -v’.execute().text Exception thrown: java.io.IOException: CreateProcess: groovy -v error=2 java.io.IOException: CreateProcess: groovy -v error=2 at Script18.run(Script18:1) When I open a command Window ( Win XP) and execute groovy -v, I get What am I doing wrong? |
|
10 Jul 2008, 05:53
Vimal Kansal (1 post) |
I am also getting the same problem. Author please help, I mean its so frustrating that you start with a book and within first few pages so hit issues with the code. I hope author is not ‘cut and run’ kind of person and responds. |
|
17 Jul 2008, 12:52
Andrei Dolganov (1 post) |
Try println “cmd /c groovy -v”.execute().text |
|
29 Jul 2008, 18:50
Rajagopalan Raghavan (5 posts) |
I think the “cmd/c” option is for dos “internal commands” like dir etc. I did try it and it still didn’t work for me. Thanks, |
|
29 Jul 2008, 19:04
Venkat Subramaniam (71 posts) |
Raghavan, on Windows Visa, within the groovysh I typed groovy:000> println “cmd /c groovy -v”.execute().text ===> null Notice the space between cmd and /c and also after /c. Can you try again with the spaces (you can copy and past from above)? |
|
27 Oct 2008, 04:14
Levi Yourchuck (1 post) |
I too encounter this issue. I have downloaded Groovy Version 1.5.7. On the command line I type: Then on the command line I type: Then I type: (and do get a notepad window up) ===> null But never any “groovy -v” variant is working. Does anyone have some insight? I can type groovy -v directly at the command prompt… |
|
01 Nov 2008, 14:05
Venkat Subramaniam (71 posts) |
Levi, within groovysh, println “cmd /c groovy -v”.execute().text prints the version of groovy for me. Since that does not work for you, can you try the following within groovysh println “groovy.bat -v”.execute().text and see if that works for you? |
|
16 Jul 2011, 14:21
B Wan (1 post) |
Using Windows 7 Starter groovy:000> println “groovy -v”.execute().text println “cmd /c groovy -v”.execute().text println “Groovy version ${org.codehaus.groovy.runtime.InvokerHelper.version}” When I boot to Linux |
| You must be logged in to comment |

