Skip to content
Steve Eynon edited this page Apr 21, 2016 · 2 revisions

Jline is a java library for handling console input and editing, similar to GNU Readline or the BSD licensed Editline libraries. Like these libraries, JLine provides emacs and vi editing modes, however it is written almost entirely in Java and is thus portable to a wide variety of platforms without having to worry about carrying around platform specific code, which is required by almost all other java line editing tools.

JLine 2.x is an evolution of JLine 1.x which was previously maintained at SourceForge.

Features

JLine sports the following major features:

  • Command history - Lines that have been previously entered may be recalled and edited and can be persisted so that they are available across sessions of your program.
  • Line editing - JLine allows full editing of the current command line and attempts to mimic as much of the behavior of GNU Readline as possible, including support for both emacs and vi key mappings.
  • Completion - JLine provides a pluggable mechanism for implementing command line tab completion (of course completion can be bound to any key you wish).
  • Custom Key bindings - Keys may be arbitrarily remapped to perform a specific action, and JLine attempts to honor any mapping that is set in your existing readline .inputrc file.
  • Character Masking - Input may be gathered from the user without any visual feedback. This is useful for prompting for passwords.
  • 99.99% Java - The vast portion of JLine is all Java, using only some small bit of native code, provided by the Jansi project, to support Windows.

License

JLine is distributed under the BSD License, meaning that you are completely free to redistribute, modify, or sell it with almost no restrictions.

Topics

Clone this wiki locally