How To Implement RMI (Remote Method Invocation) In Java Without Using Any IDE..

How To Implement RMI (Remote Method Invocation) In Java Without Using Any IDE..


Hello Everyone, Today I will be showing you how to Implement RMI in Java
without using any IDE… So, Let’s Get Started.. First of all create a
directory or folder with the name ” RMI ” You can use any other name.. Now create two sub
directories with the name
“Client” and “Server” Now in the client directory,
I will be creating two java files with the
name : MainClient.java and RemoteInterface.java So I will be writing code for these two java files.. Now I will be saving this file.. Now I will write code for RemoteInterface.java Now code for RemoteInterface.java is completed
Now I will be saving the file.. Now in the Server directory, I
will be creating three java files : MainServer.java,
RemoteInterface.java (common in client) and other java file
for the implementation of the RemoteInterface.java So, let’s now create them.. Now I will copy the RemoteInterface.java
from client directory and
paste into the server directory.. Now I will be writing the code for MainServer.java Code for MainServer.java is completed.. Now I will write the code for RIImplement.java this java file is
mainly responsible for implementing the methods
of RemoteInterface.java and it is saved now.. Now open command prompt from client directory.. and another command prompt from the server directory.. Now compile all java files from server directory… It is successfully compiled… I will write the command .. Now the stub file generated using that command This stub file is responsible for the connection between client
and server Copy stub file from server directory
and paste in client directory… Give the port number mentioned in java file
along with the command.. Just minimize this rmiregistry command prompt .. It will give a message – Server is ready Now minimize the command prompt opened from
server directory.. Now shift to command prompt opened from client
directory Now compile all java files in client directory.. It is successfully compiled.. It’s Done.. Thanks for watching..
Plz do subscribe, like and share Plz comment if you have queries regarding
video..
For more info, check the description part below..

3 thoughts on “How To Implement RMI (Remote Method Invocation) In Java Without Using Any IDE..”

  1. Edilson Arias Pardo

    If I need to receive a response from the client, such as a number and the server makes a decision depending on the number, how can I do it?

Leave a Reply

Your email address will not be published. Required fields are marked *