First of all the Linux box has to be running some kind of server that allows remote systems to submit commands to it. There are several possibilities: you could use an FTP server, or an REXEC server; even a regular HTTP server can allow commands to be submitted with suitable configuration. And there are probably others.
Once you have decided which type of server to use, then write the Java program to communicate with it. Obviously it's not possible to say much about that at present.