private static Properties toProperties(String[] args) {
    Properties props = new Properties();
    // loop all args and pick out key=value pairs...
    for (final String arg : args) {
      // VM args...
      if (arg.startsWith("-J")) {
        int eq = arg.indexOf("=");
        String key = arg.substring(2, eq);
        String value = arg.substring(eq + 1);
        System.setProperty(key, value);
      } else if (arg.indexOf(AGENT_DEBUG) > 0) {
        int eq = arg.indexOf("=");
        String key = arg.substring(2, eq);
        String value = arg.substring(eq + 1);
        System.setProperty(key, value);
      }

      // all other args
      else if (arg.indexOf("=") > 0) {
        int eq = arg.indexOf("=");
        String key = arg.substring(0, eq);
        String value = arg.substring(eq + 1);
        props.setProperty(key, value);
      }
    }

    return props;
  }
Parses the array of command-line arguments (format: key=value) into an instance of Properties.

@param args the command-line arguments to convert into a Properties
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/AgentConfigImpl.java