Step 3 – Run rmiregistry command (see Figure 10). You will not receive any message, just a blinking pointer on the next line of your window and the title of the window is changed.

Figure 10. Running rmiregistry command

Step 4 – Open a new command prompt, and run javaHelloServerComponent (see Figure 11). Is OK, if you receive the message Binding complete….

Figure 11. Running HelloServerComponent

Step 5 – Open a new command prompt, and run java HelloServerComponent. If everything goes perfect, you should receive the following message (see Figure 12): Message received: Hello there, student.
Figure 12. Running HelloClientComponent
In this moment, we have covered all the basic steps that we need in order to set RMI client-server application.

5. Annexes

5.1. Add javac as environment variable
In order to add javac as environment variable, follow the next steps:
  1. Enter your Start menu, and type environment and wait for a couple of seconds and choose Edit the system environment variables (Figure 13).

Figure 13. Access environment variable

  1. The window is opened (Figure 14), and press the Environment variables… button from the bottom of the window.

Figure 14 System Properties for adding environment variables

  1. You can add your javac command as environment variable in two ways (you decide):
Using netbeans for java
After you have decided where you want to place your path, select the variable Path, and press Edit (Figure 15).

Figure 15. Choosing the desired type of variable

  1. Go at the end of the entire string with different paths, and add your path to javac file. In my case it will be: C:Program FilesJavajdk1.8.0_40bin, and press OK button (Figure 16).

Rmi Program Using Java

Figure 16. Setting the path

  1. In order to verify that your path is set correctly, open a command prompt and type java –version. If everything is OK, you should receive the message shown in figure 17.

Figure 18. Path checking

6. References

[1] Jan Graba, An Introduction to Java Networking Programming, 2013, Springer Publishing House, ISBN:978-1-4471-5253-8.
[2] Internet Protocol Suite (TCP), http://en.wikipedia.org/wiki/Internet_protocol_suite

Netbeans Program Example

[3] System Architecture, http://www.cs.mun.ca/~michael/java/jdk1.1-beta2-docs/guide/rmi/rmi-arch.doc.html

History

08.03.2015: Release of the first article version Boezio de consolatione philosophiae pdf reader.

Simple Rmi Program In Netbeans

09.03.2015: Code listening for files has been added. The archive with the files of the project has been attached.