Well there are two halves to your program: the server and the clients. Depending on what the program does, you could just make the server output a web application and have the mobile/desktop clients just access the web page. An example of that would be Gmail.

If you already know Java, just look up server frameworks for it and pick one to accomplish whatever technique you are using.