Java IDL: Running The "Hello World" Example on 2 machines
Java IDL: The "Hello World" Example on 2 machines
To enable the Hello World Tutorial to run on two machines, follow the steps as directed
in the tutorial, with the following changes. This tutorial
was written for the Java (tm) 2 Platform, Standard Edition (J2Se(tm)), version 1.3. In
this example, the client, stubs, and skeletons are located on the client machine, and the
server and name server are located on the server machine. This scenario can be changed to
meet your needs and is provided simply as an introduction to one way this can be
accomplished.
Create and compile the Hello.idl file on the client machine as indicated in
the tutorial:
idlj -fall Hello.idl
Create HelloClient.java on the client machine. Compile the .java files,
including the stubs and skeletons (which are in the directory HelloApp):
javac *.java HelloApp/*.java
Create HelloServer.java on the server machine. Compile the .java files:
javac *.java
Start the Java IDL name server on the server machine. To do this on Unix:
tnameserv -ORBInitialPort 1050&
To do this on Windows:
start tnameserv -ORBInitialPort 1050
Note that the name server will run on port 1050 if you enter the command as
listed. If you want a different nameserverport, replace 1050 with the correct
port number.
On the server machine, start the Hello server, as follows:
java HelloServer -ORBInitialPort 1050
If you used a different nameserverport, replace 1050 with the correct port
number.
On the client machine, run the Hello application client. From a DOS prompt or shell,
type: