If you wanted to do this in Java, you need to learn about Sockets and reading / writing to them.
On the other hand, if you have physical access to the machine and don't really care to learn about Sockets, you can use netcat / cryptcat. Or if you want to tinker around with the metasploit framework and some social engineering trickery, you can try to trick him into downloading something malicious that looks legitimate (like a java update). Or if he is running an un-patched OS, you can use nmap to check for certain CVEs and then try to exploit them.