title: Is there an alternative to BeanShell ? Something like javascript or groovy console for Java?
body: <p>I was wondering if there is some kind of shell that would just listen to user input (with a line buffer) and run in internally from within main method, including jdk on classpath.
  So that it would look like JavaScript console in browsers or groovy console.
  It would be handy for testing snippets of code.</p>
  
  <p>One could just write this into the shell and hit return:</p>
  
  <pre><code>Map&lt;String, String&gt; env = System.getenv();
  for (String envName : env.keySet()) {
      System.out.format("%s=%s%n", envName, env.get(envName));
  }
  </code></pre>
  
  <p>This is what bsh.Interpreter can do. But I find it very hard to use. I cannot move back/left with cursor on the shell line... ^[[D^[[D^[[D  .... I can only delete last characters. Not sure if it is OS specific (I'm on linux) but it is very inconvenient...</p>
  
  <p>I mean something in Java language, not Jruby, Jython or Groovy</p>