You can use WMI to connect to a remote windowed computer and ssh to connect to a uinx machine.
There are many free SSH implementations for java. If you need WMI, I would recommend you use jinterop.
to use WMI
select * from WIN32_Process;
for using ssh
ps.
The window also supports telenet, so you can connect to windows using telnet if you want.