// standalone Hello client // // assumes that the server is running on the same system as the client // // R. Perry, June 1998 import java.rmi.*; public class HelloClient { public static void main(String args[]) { int port = 21099; if (args.length == 1) port = Integer.parseInt(args[0]); // Create and install the security manager System.setSecurityManager(new RMISecurityManager()); try { Hello o = (Hello) Naming.lookup("rmi://:" + port + "/HelloServer"); System.out.println("Message: " + o.sayHello()); } catch (Exception e) {e.printStackTrace();} } }