title: pass Sample Command Line Parameters in the format -h name in eclipse
body: <p>I am writing a Java client program for MQ client to perform the initial test for that I need to pass the below parameters as below:
  Sample Command Line Parameters
  //  <code>-h 127.0.0.1 -p 1414 -c CLIENT.CHANNEL -m A1 -q TEST.QUEUE</code> in eclipse.
  I got <code>IllegalArgumentException</code> when I passed the values in program arguments in eclipse.how to pass the above parameters  Please help me on this.</p>
  
  <p>MY code:</p>
  
  <pre><code>private void init(String[] args) throws IllegalArgumentException {
      for (int i = 0; i &lt; args.length; i++) {
      System.out.println(args[i]);
  }
  
  ...
  
  params = new Hashtable&lt;String, String&gt;();
  
  if (args.length &gt; 0 &amp;&amp; (args.length % 2) == 0) {
      for (int i = 0; i &lt; args.length; i += 2) {
          params.put(args[i], args[i + 1]);
      }
  } else {
      throw new IllegalArgumentException();
  }
  
  if (allParamsPresent()) {
      qMgrName = (String) params.get("-m");
      System.out.println("qMgrName: " + qMgrName);
      outputQName = (String) params.get("-q");
      System.out.println("outputQName: " + outputQName);
      replytoQueueName = (String) params.get("-r");
      System.out.println("replytoQueueName: " + replytoQueueName);
      url = (String) params.get("-j");
      System.out.println("url: " + url);
      username = (String) params.get("-u");
      System.out.println("username: " + username);
      password = (String) params.get("-pp");
      System.out.println("password: " + password);
  </code></pre>