I committed a variant of Kabir's patch to upstream. It does not use a client socket factory which prevents the need for client code and allows jconsole to work out of the box. Unfortunately this also means that the server requires the java.rmi.server.hostname property to be set if the interface is not the one that matches the hostname. So the changes also add that.
So to connect to a JSR-160 service out of the box with no other code or libs you can do:
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.rmi.registry.RegistryContextFactory");
JMXServiceURL address = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://127.0.0.1:1090/jmxrmi");
JMXConnector cntor = JMXConnectorFactory.connect(address, env);
This is what jconsole does under the hood.