RMI – Program in Java

Home/RMI/RMI – Program in Java
RMI – Program in Java 2017-06-13T11:00:29+00:00

RMI Program Code and Example:

CLICK HERE for step by step learning with description of each step

To run program of RMI in java is quite difficult, Here I am going to give you four different programs in RMI to add two integer numbers.

First program is for declare a method in an interface.

Second Program is for implementing this method and logic.

Third program is for server side.

And last one is for client side.

At the last I will give steps to run this program in one system.

Calculator.java


 


CalculatorImpl.java

 


CalculatorServer.java

 


CalculatorClient.java

 


Steps to run this programs:
First of all put these four programs inside bin folder of JDK.
As an example suppose our JDK folder is inside java folder in drive D:
Now open command prompt and do following steps.
cd\
d:
cd Java\jdk1.6.0_23\bin
javac Calculator.java
javac CalculatorImpl.java
javac CalculatorServer.java
javac CalculatorClient.java
rmic CalculatorImpl
start rmiregistry
java CalculatorServer
open another cmd and again go to same path d:\Java\jdk1.6.0_23\bin
java CalculatorClient

Output:

Prev Next