I've used JLine to add history, etc. to a Clojure REPL (JVM process) when executed from the command line. It just magically worked and worked well, so I never bothered to investigate anything else.

Answer from G__ on Stack Overflow
🌐
GitHub
github.com › aclemons › java-readline
GitHub - aclemons/java-readline: GNU readline and BSD editline wrappers for Java · GitHub
This is my "port" of GNU-Readline to Java. Actually, it is a crude wrapper using the Java Native Interface (JNI). Starting from version 0.6, alternative libraries are supported. Currently only Editline is implemented, but adding support for other implementations should be easy.
Starred by 21 users
Forked by 3 users
Languages   Java 57.2% | C 28.0% | Makefile 6.2% | Shell 4.9% | HTML 3.7%
🌐
GitHub
github.com › aeshell › aesh-readline
GitHub - aeshell/aesh-readline: Java Readline API · GitHub
May 13, 2026 - Æsh Readline is a library for handling console input with the goal to support most GNU Readline features.
Starred by 25 users
Forked by 16 users
Languages   Java
🌐
SourceForge
java-readline.sourceforge.net
Java-Readline
You will be redirected in 10 seconds to the new location https://github.com/aclemons/java-readline
🌐
Tutorialspoint
tutorialspoint.com › java › io › bufferedreader_readline.htm
Java - BufferedReader readLine() method
The Java BufferedReader readLine() method read a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed.
🌐
SourceForge
sourceforge.net › projects › java-readline
Java Readline download | SourceForge.net
April 17, 2013 - JLine is a java library for reading and editing user input in console applications. It features tab-completion, command history, password masking, customizable keybindings, and pass-through handlers to use to chain to other console applications.
🌐
GitHub
github.com › qmx › jreadline
GitHub - qmx/jreadline: JReadline is a Java library for handling console input. · GitHub
JReadline is a Java library for handling console input with the goal to support most GNU Readline features.
Starred by 5 users
Forked by 5 users
Languages   Java 99.6% | Groovy 0.4%
🌐
Jeszy's blog
jeszysblog.wordpress.com › 2012 › 04 › 14 › readline-style-command-line-editing-with-jline
Readline style command line editing with JLine | Jeszy's blog
April 15, 2012 - JLine 2.x is a free and open source console I/O library written in Java and distributed under the Modified BSD License It offers line-editing and history capabilities for console applications, that are similar to the functions provided by the GNU readline library.
Find elsewhere
🌐
GitHub
github.com › jmesnil › jreadline
GitHub - jmesnil/jreadline: JReadline is a Java library for handling console input.
JReadline is a Java library for handling console input with the goal to support most GNU Readline features.
Forked by 63 users
Languages   Java 99.6% | Groovy 0.4% | Java 99.6% | Groovy 0.4%
🌐
GitHub
github.com › jline › jline2
GitHub - jline/jline2: Jline 2.x · GitHub
JLine is a Java library for handling console input. It is similar in functionality to BSD editline and GNU readline.
Starred by 713 users
Forked by 181 users
Languages   Java
🌐
Princeton CS
introcs.cs.princeton.edu › java › stdlib › javadoc › StdIn.html
StdIn
while (StdIn.hasNextLine()) { String line = StdIn.readLine(); StdOut.println(line); }
🌐
Medium
medium.com › @AlexanderObregon › javas-bufferedreader-readline-method-explained-66b76877a7e4
Java’s BufferedReader.readLine() Method Explained | Medium
August 30, 2024 - Reading large files efficiently is a common requirement in many Java applications. If you’re processing logs, handling large datasets, or reading configuration files, the BufferedReader class, particularly its readLine() method, is a vital tool. This article will take a look at the BufferedReader.readLine() method, explaining how it works, its performance benefits, and common use cases.
🌐
W3Schools
w3schools.com › java › java_bufferedreader.asp
Java BufferedReader
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Main { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new FileReader("filename.txt"))) { String line; while ((line = br.readLine()) != null) { System.out.println(line); } } catch (IOException e) { System.out.println("Error reading file."); } } }
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-read-file-line-by-line
Java Read File: Complete Guide with Examples | DigitalOcean
February 20, 2025 - package com.journaldev.readfileslinebyline; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class ReadFileLineByLineUsingBufferedReader { public static void main(String[] args) { BufferedReader reader; try { reader = new BufferedReader(new FileReader("sample.txt")); String line = reader.readLine(); while (line != null) { System.out.println(line); // read next line line = reader.readLine(); } reader.close(); } catch (IOException e) { e.printStackTrace(); } } }
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › io › Console.html
Console (Java Platform SE 7 )
For simple applications requiring only line-oriented reading, use readLine(java.lang.String, java.lang.Object...).
🌐
iO Flood
ioflood.com › blog › java-read-line
Java readLine() Method: Proper Usage Guide
February 20, 2024 - Think of Java as a librarian, capable of retrieving any line from the book of your program. It has built-in methods that can read lines from various sources, making it a versatile and handy tool for various tasks. In this guide, we’ll walk you through the process of reading a line in Java, from the basics to more advanced techniques. We’ll cover everything from using the BufferedReader class and the readLine() method, tcco dealing with different sources such as files, user input, and more.
🌐
GeeksforGeeks
geeksforgeeks.org › java › console-readline-method-in-java-with-examples
Console readLine() method in Java with Examples - GeeksforGeeks
June 12, 2020 - Below programs illustrate readLine(String, Object) method in Console class in IO package: Program 1: ... // Java program to illustrate // Console readLine(String, Object) method import java.io.*; public class GFG { public static void main(String[] args) { // Create the console object Console cnsl = System.console(); if (cnsl == null) { System.out.println( "No console available"); return; } String fmt = "%1$4s %2$10s %3$10s%n"; // Read line String str = cnsl.readLine( fmt, "Enter", "string : "); // Print line System.out.println( "You entered : " + str); } }
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › api › java.io.bufferedreader.readline
BufferedReader.ReadLine Method (Java.IO) | Microsoft Learn
Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), a carriage return followed immediately by a line feed, or by reaching the end-of-file (EOF).
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › io › BufferedReader.html
BufferedReader (Java Platform SE 7 )
public String readLine() throws IOException · Reads a line of text. A line is considered to be terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a linefeed. Returns: A String containing the contents of the line, not including ...