Compiling and running the Hello World Application


Compiling the Client Application

  1. Compile HelloClient.java:
    
    javac HelloClient.java HelloApp\*.java 
    
  2. Correct any errors in your file and recompile if necessary.
  3. You should see HelloClient.class in the project directory.

Compiling the Server

  1. Compile HelloServer.java:
     
    
    javac HelloServer.java HelloApp\*.java
    
  2. Correct any errors in your file and recompile if necessary.
  3. You should see HelloServer.class and HelloServant.class .

Running the Client-Server Application

  1. From an MS-DOS system prompt (Windows) or command shell (UNIX), start the Java IDL name server:
    tnameserv -ORBInitialPort nameserverport 
    
  2. From a second prompt or shell, start the Hello server:
    
    
    java HelloServer -ORBInitialHost nameserverhost
         -ORBInitialPort nameserverport
    
  3. From a third prompt or shell, run the Hello application client:
     
    
    java HelloClient -ORBInitialHost nameserverhost 
         -ORBInitialPort nameserverport
    
  4. The client prints the string from the server to the command line:
    
    

    Hello world!!

Remember to stop both the tnameserv and the HelloServer processes after the client application returns successfully.