Consider the following scenario:
Jenkins running with a master on machine A and a slave on machine B. Rather than the master's XML config referring to a hard coded Java path it was changed to reference 'java', in the environment PATH variable. This works fine for the master running on machine A, however the slave on machine B is no longer able to connect to the master host PC.
The (Windows) firewall rules for inbound traffic on machine A allow inbound communication on any protocol and port connections to 'C:\Program Files\Java\jre7\bin\java.exe', so the Jenkins service should work but it isn't. The only way I can make the connection work is by disabling the firewall.