code: public void runCommandLine() throws IOException {
  		final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  		try {
  			System.out.println("Running jmx client interface.  Type '" + HELP_COMMAND + "' for help.");
  			doLines(0, new LineReader() {
  				@Override
  				public String getNextLine(String prompt) throws IOException {
  					System.out.print(prompt);
  					System.out.flush();
  					return reader.readLine();
  				}
  			}, false);
  		} finally {
  			reader.close();
  		}
  	}
docs: Run the Jmx command line client reading commands from {@link System#in}.