After starting the registry, we can next start the RMI object server main program on the server computer. Like starting the registry, this step is independent of whether the client is an applet or an application.
Remember that we coded the main method to create an object and register a name for the object in the RMI registry. The diagram shows the MeetingServer virtual machine containing the MeetingServer remote object as well as its skeleton.
The object server virtual machine needs access to all of the class files shown in the diagram: the MeetingServer main program, the skeleton class file, and the interface class file. Therefore, before starting the server program, you must ensure that all of these files are in the classpath. The stub class file must be installed on a web server; note that we reference the web server in the command to start to the object server main program. In this case, the codebase property specifies only a hostname, not a directory, so the web server will serve from its default directory. We will direct you to your web server's documentation for more details on how to setup directories.
Starting in JDK 1.2, RMI servers also need to reference a policy file that grants or denies permissions for the remote object. In this case, we created a policy file that grants all permissions; that's OK for a sample program like this one, but it's probably too dangerous for a production environment. Note that we must specify the policy file when we start the object server.
As before, this page shows the Microsoft Windows command to run the object server main program - see your operating system's documentation for specific details.