Steps for running RMI Program


You are running both the Server and Client programs on the same machine:

set path=C:\j2sdk1.4.0-rc\bin

Step 1: compile all the java programs

1) javac dollar.java

2) javac dollarimpl.java

3) javac dollarclient.java

4) javac dollarserver.java

Step 2: Generate stubs and skeleton

> rmic dollarimp

Step 3: start the rmiregistry

> start rmiregistry [A new blank window will be generated]

Step 4: In a new window

> java dollarserver

Step 5: In another window

> java dollarclient 127.0.0.1 4

Note:

  • 127.0.0.1 is the loopback IP and 4 is the argument, If you have the server on other machine then give the IP of that machine
  • You are giving the loopback address and dollar value which will get converted to Rupees and displays the result.
  • Instead of giving loop back IP address of the machine you can also localhost

>java dollarclient localhost 4

Server Program: dollarserver.java << Previous
Next >>What is RMI?

Our aim is to provide information to the knowledge seekers. 

comments powered by Disqus






Footer1