Skip to content

Tag: external

Calling external process from Groovy/Java gives unexpected result

From Groovy/Java I try to execute following command: cmd /c echo mytext. Groovy: 2.4.21, 3.0.9 Java: zulu11.50.19-ca-fx-jdk11.0.12-win_x64 The result is mytext” (including ending double quote). I cannot figure out why the double qoute is there. Can anybody help to explain me why is it there? Thank you. Answer in short: ProcessBuilder will wrap each argument that contains spaces with double