Using Java's RMI would probably be the easiest approach. Here's a tutorial from oracle with the overview of the RMI methodologies and an example: http://docs.oracle.com/javase/tutorial/rmi/index.html
You'll still need to go over the documentation of the KMPlayer with a fine tooth comb as well. It should have documented the command line functionality, and even better if you can pipe commands to a running gui through the process itself.
The fun part is this: it may not even be this complex to perform. With many media servers nowadays they have built in RSTP servers (I think that's the protocol it uses). This means they would have a listener on a socket for the source machine which you can open to and send commands to the running RSTP directly. You'll need to check the player's docs for information about this, and learn the RSTP communication RFC as well (there should be a link on wiki to the rfc as well). Some apps like VLC also have a built in remote control interface to take this layer away, although I've never attempted to use it.
And before you ask, if you have a running RSTP for the player, yes you could use PHP as well. Although for anything interactive especially in a local lan I'd suggest you don't use a web based language for that task.