Remote Method Invocation (RMI) in Java is used for:
1
Enhancing the security of Java applications
2
Providing a graphical user interface toolkit
3
Creating distributed applications by enabling objects to invoke methods on remote objects
4
Compiling Java source code into bytecode