Libraries for constructing an interactive shell for Java application

ianc1215 picture ianc1215 · Dec 29, 2012 · Viewed 19.6k times · Source

I am looking for libraries for Java that will allow me to create an interactive shell. I have done some search around and have not turned up a whole lot. Most of what I have found is libraries for adding command argument parsing to my application which does not help me a lot.

The best lead I have found is a library called Cliche which does exactly what I need. The problem is its too simple. I am looking for something that has more customization.

Has anyone come across something a little more advanced?

Answer

mikera picture mikera · Dec 29, 2012

Options to consider:

  • javacurses / JCurses - a console-based windowing toolkit, similar to the UNIX curses design
  • swing-console might be appropriate if you want a console-style view / output in a Swing GUI window. you could use this to build an interactive shell.
  • JLine - library for console input similar to GNU readline
  • Several JVM languages offer an interactive REPL environment which can be used as an interactive shell, e.g. Clojure