Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI Hello World between two system?  RSS feed

 
Rosy Singh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am new in this field and trying to write a simple RMI Hello World program which will work based on
client and server.
Thant means Client program from system1 will invoke Server program's method which is in system2.

Though i wrote a Hello World RMI which run on same system, but i am not getting what are the changes
and command i need to use to run it between two system.

Here is the code which i wrote for same system only.

Directory structure
RMI_DEV
......|-src
......|....|-RInterface.java
......|....|-RServer.java
......|....|-RClient.java
......|
......|-classes
............|-RInterface.class
............|-RServer.class
............|-RClient.class
............|-RServer_Stub.class






Steps to compile, generate stub and run
\src>javac -d ../classes *.java
\classes>rmic RServer (Generate RServer_stub.class)
\classes>start rmiregistry (Open new cmd window)
\classes>java RServer
Server Ready

Open New cmd
\classes>java RClient
Hello RMI

Kindly guide me what are the steps i need to follow, to write RMI Hello World program between two system.

Thanks in advance!



 
Vijitha Kumara
Bartender
Posts: 3973
24
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is something you may interested in reading though generating stubs and skeletons is not required with the latest JDKs. And Welcome to JavaRanch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!