Win7 x64: x86 Java runtime creates bad PATH on x64 OS causing ' \Java\jre6\bin"" was unexpected at this time.' error
I had installed the x86 Java 6, Version 6 update 29, (build 1.6.0_29-b11), which installs into C:\Program Files (x86)\Java\jre6. When I started the jenkins client and ran a build I received ' \Java\jre6\bin"" was unexpected at this time.' errors in the console any time a shell command was invoked on the slave.
Upon investigation it appears that the Java runtime set to path to (as reported by the Manage Jenkins --> Manage Nodes --> My Slave --> Systeminfo page:
Searching about on the internet I see several projects reporting issues about unescaped parens being added to the path.
I can work around this issue by using the x64 JRE on 64-bit OS.