code: private Registry startRmiRegistryProcess(Configuration configuration, final int port) {
  
          try {
              final String javaHome = System.getProperty(JAVA_HOME);
              String command = null;
              if (javaHome == null) {
                  command = "rmiregistry";
              } else {
                  if (javaHome.endsWith("bin")) {
                      command = javaHome + "/rmiregistry ";
                  } else {
                      command = javaHome + "/bin/rmiregistry ";
                  }
              }
  
              // try with new command with full path
              return internalProcessStart(configuration, port, command);// NOPMD
  
          } catch (Exception e1) {
              // if failed exit...
              LOGGER.error("The RMI Registry cannot be started.", e1);
              throw new UnsupportedOperationException("could not start rmiregistry!!! Reason: " + e1.toString(), e1);// NOPMD
          }
  
      }
docs: start new rmiregistry using PrcessBuilder
  
  @param port
  @return