Skip to content

Migrate from jline2 to jline3#215

Merged
bbatsov merged 3 commits intomainfrom
migrate-jline2-to-jline3
Feb 23, 2026
Merged

Migrate from jline2 to jline3#215
bbatsov merged 3 commits intomainfrom
migrate-jline2-to-jline3

Conversation

@bbatsov
Copy link
Copy Markdown
Collaborator

@bbatsov bbatsov commented Feb 23, 2026

jline 2.14.6 is EOL. This replaces it with org.jline/jline 3.28.0, the latest stable release still supporting Java 8+ (4.x requires Java 11+).

The jline3 API is significantly different so all integration code was rewritten: terminal/reader setup uses the builder pattern, the Completer interface now takes (LineReader, ParsedLine, List<Candidate>), and history is managed by DefaultHistory. One notable workaround: jline3's DumbTerminal doesn't properly handle ByteArrayInputStream (throws EndOfFileException immediately instead of reading data), so piped/non-interactive input bypasses jline3 entirely and uses a simple BufferedReader. Old jline2-format history files are automatically renamed on first run.

All existing tests pass, including integration tests with both standalone and nREPL modes.

jline 2.14.6 is EOL; replace with org.jline/jline 3.28.0 (the latest
release still supporting Java 8+).

Key changes:
- Replace all jline2 imports with jline3 equivalents (LineReader,
  LineReaderBuilder, TerminalBuilder, etc.)
- Rewrite terminal/reader setup using jline3's builder pattern
- Update Completer interface to jline3's (LineReader, ParsedLine,
  List<Candidate>) signature
- Add history file format migration (renames old jline2-format files)
- Suppress jline3's JUL logging noise (replaces old Log.setOutput hack)
- Bypass jline3 for piped/non-interactive input since jline3's
  DumbTerminal doesn't support ByteArrayInputStream; use a simple
  BufferedReader instead
@bbatsov bbatsov mentioned this pull request Feb 23, 2026
Move test jars from spec/ to target/test-jars/ and remove the spec/
directory entirely now that all tests use clojure.test.
@bbatsov bbatsov force-pushed the migrate-jline2-to-jline3 branch from 8d7b4a9 to 03b6475 Compare February 23, 2026 11:02
@bbatsov bbatsov merged commit e299855 into main Feb 23, 2026
11 of 12 checks passed
@bbatsov
Copy link
Copy Markdown
Collaborator Author

bbatsov commented Feb 23, 2026

Mission successful! 🎉

@bbatsov bbatsov deleted the migrate-jline2-to-jline3 branch February 23, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant