JLine - Advanced Console Input for Java
Overview
JLine is a powerful Java library that brings advanced console input handling capabilities to your applications. It provides functionality similar to BSD editline and GNU readline, while offering additional features that rival the sophisticated ZSH line editor.
Key Features
- Rich command-line editing capabilities
- Customizable tab completion
- History management with search
- Syntax highlighting
- Multi-line editing
- Unicode support
- Platform-independent implementation
- Flexible keyboard mapping
- Advanced line editing features (cut/paste, word movement, etc.)
See It in Action
Watch JLine’s capabilities in this interactive demo:
Getting Started
Maven Dependency
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>3.x.x</version>
</dependency>
Quick Example
Terminal terminal = TerminalBuilder.terminal();
LineReader lineReader = LineReaderBuilder.builder()
.terminal(terminal)
.build();
String line = lineReader.readLine("prompt> ");
Evolution of JLine
JLine has evolved significantly since its inception:
- JLine 3 (2015-Present)
- Current active version
- Complete rewrite with modern Java features
- Enhanced terminal support
- Rich building blocks for creating interactive applications
- Repository
- JLine 2 (2009-2015)
- Major evolution of the original codebase
- Improved architecture and features
- Repository
- JLine 1 (2002-2009)
- Original version by Marc Prud’hommeaux
- Established core functionality
- Repository
Documentation
Community
License
JLine is released under the BSD License.
JLine is actively maintained and welcomes contributions from the community.