In the example, stay in the rmi directory.
[Recall that the class files are in c:\courses\cps530\rmi\mahmoud\ch8 and the package name is mahmoud.ch8]
Type,
start rmiregistry
This opens a child window to run the registry server in. The server runs by default on port 1099.
You can run under another port, for example,
The registry is now waiting for a RMI server to register some remote objects with it.
From the same directory, just type
java mahmoud/ch8/ArithImpl
java mahmoud/ch8/ArithImpl &
Just run the client program in the normal way.
java mahmoud/ch8/ArithApp
The code shown for this example assumes the registry runs on the default port 1099.
If it rans on, say, 2001, you would have to change the URL in the code from, for example, //Gateway or rmi://Gateway to //Gateway:2001 or rmi://Gateway:2001