This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The Jakarta Commons Net library implements both Telnet and rexec/rcmd/rlogin, both of which allow you to log into a remote machine and issue commands on it. If you want something more secure, have a look at SSH, for which Java libraries are available as well.