I know it's a bit strange but i'm trying to run the java executable from a groovy script:
def mycommand = "java -version"
def env = System.getenv().collect { k, v -> "$k=$v" }
def mycommandOut = mycommand.execute(env,null).text
println mycommandOut
this work well on windows but when I run it on Linux it seems to does nothing.
If i set mycommand = "ls -la" it works like a charm.
If i set mycommand = "foobar" i get: java.io.IOException: Cannot run program "foobar": error=2
Any hints?