When I run my build process on Windows Server 2008, it fails with the error message like
Cannot run program \"foo\": CreateProcess: error=2, The syste
Couldn't get other it to work by the other answers. Ended up setting the variable in my slave node launcher (batch) script:
SET PATH=C:\cygwin64\bin;%PATH% java -jar agent.jar -jnlpUrl ...