title: Use java scanner at cmd
body: <p>How to read data from cmd using </p>
  
  <p>i used this method and it works fine until it arrive to user input and the debugger get into hasnext and hang</p>
  
  <pre><code>public String readCMD() {
      try {
          Scanner sc =new Scanner(in);
          StringBuilder sb = new StringBuilder();
          String ch ;
          while (sc.hasNext()) {
              ch = sc.next();
              System.out.print(ch);
              sb.append(ch);
  
          }
          return sb.toString();
      } catch (Exception e) {
          System.out.println(e.getCause());
      }
      return null;
  }
  </code></pre>