import java.io.IOException; import java.rmi.RMISecurityManager; import net.jini.core.discovery.LookupLocator; import net.jini.core.lookup.ServiceRegistrar; public class Vote { public static void main(String[] args) throws Exception { String host = "jini://localhost"; System.setSecurityManager(new RMISecurityManager()); if (args.length != 0) host = "jini://" + args[0]; new Vote(host); } public Vote(String host) throws IOException { try { LookupLocator lookup = new LookupLocator(host); ServiceRegistrar registrar = lookup.getRegistrar(); new Urne(registrar); } catch (Exception e) { System.out.println(e.getMessage()); System.exit(0); } } }