System.setSecurityManager(new RMISecurityManager()); ComplexNumberFactory cnf = (ComplexNumberFactory) Naming.lookup(args[0] + "/ComplexNumberFactory"); ComplexNumber cn = cnf.getInstance(5, 8); System.out.println(cn);