Since Java 5 working with RMI (Remote Method Invocation) is very easy. You don’t need the rmic compiler unless you work with legacy RMI clients. Now stubs are generated automatically at runtime. As a result, writing distributed or client-server applications becomes trivial.
Read the full tutorial here: The 10 minutes “Getting started with RMI” tutorial