package rmitest; import java.rmi.*; import javax.naming.*; public class SquareServer { public static void main(String args[]) throws NamingException, RemoteException { Context namingContext = new InitialContext(); Squarer s = new SquarerImpl(); try { namingContext.bind("rmi:squarer", s); } catch (javax.naming.NameAlreadyBoundException nabe) { namingContext.rebind("rmi:squarer", s); } } }