This code looks similar to code in the object server main - like the object server, a client application also can optionally set a security manager. And the reason is similar too: the RMI runtime will automatically download the remote object's stub class file to the client, but can only do so if the application installs a security manager. If the application uses the default security manager, you will need to pre-install the stub class files in the client computer's classpath or else the application will catch a security exception.

You should also note that in this code, the main method simply throws RMI-related exceptions back to the command line. A more robust application would contain try-catch blocks to localize error processing.