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 addserverintf.java

2) javac addserverimpl.java

3) javac addclient.java

4) javac addserver.java

Step 2: Generate stubs and skeleton

> rmic addserverimpl

Step 3: start the rmiregistry

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

Step 4: In a new window

> java addserver

Step 5: In another window

> java addclient 127.0.0.1 4 5

Note:

  • 127.0.0.1 is the loopback IP and 4 and 5 are two arguments, If you have the server on other machine then give the IP of that machine
  • You are giving the loopback address and the result of arithmatic operations are displayed

  • Instead of giving loop back IP address of the machine you can also localhost

  • >java addclient localhost 4 5

     

    Server Program: addserver.java<< Previous
    Next >>What is ASP?

    Our aim is to provide information to the knowledge seekers. 


    comments powered by Disqus








    Footer1