You can use
RMI to allow a java program running on your windows machine to communicate with a java program running on your linux machine. You can also run ssh or rsh from your java program, and if telnet is enabled on your linux machine connect directly to port 23.