Reputation: 142
I tried to pass an command or value at runtime into command prompt from groovy script. could anyone help on this ?
Upvotes: 0
Views: 452
Reputation: 1621
Put your command in an Array: then use execute ()
to run as in command prompt like shown below.
def command = ['ls']
command.execute()
I feel like you are looking for a method like this: Use this method.
void executejar (String jarname)
{
def command = ['java','-jar', jarname ]
println command.execute().text
}
Upvotes: 1