Fix REPL on JDK 24+ for Scala versions with split JLine modules - #4436
Open
lrytz wants to merge 1 commit into
Open
Fix REPL on JDK 24+ for Scala versions with split JLine modules#4436lrytz wants to merge 1 commit into
lrytz wants to merge 1 commit into
Conversation
`--add-modules org.jline` names the `org.jline:jline` uber-jar's module. Scala 2.13.19 switches to the individual JLine modules, where it doesn't exist: java.lang.module.FindException: Module org.jline not found `ALL-MODULE-PATH` (https://openjdk.org/jeps/261) works for both shapes and merges the Scala 2 and Scala 3 branches. `--enable-native-access` has no equivalent, so it still needs a module name.
Gedochao
self-requested a review
August 20, 2026 10:53
Contributor
|
Does it work with 2.12 too? |
Contributor
Let's run integration tests on this. They're currently gated to run on Scala 2.13+ |
Gedochao
reviewed
Aug 21, 2026
| javaVersion: Int | ||
| ): Seq[String] = | ||
| if javaVersion >= 24 && jlineArtifacts.nonEmpty then { | ||
| val hasSplitModules = |
Contributor
There was a problem hiding this comment.
Suggested change
| val hasSplitModules = | |
| val hasJLineNative = |
NIT more readable, IMO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Scala 2 branch passed
--add-modules org.jline, which is the automaticmodule name of the
org.jline:jlineuber-jar. Scala 2.13.19 switches to theindividual JLine modules (as Scala 3 already did), where no
org.jlinemoduleexists, so the REPL dies with:
java.lang.module.FindException: Module org.jline not found
scala/scala#11275
Use
--add-modules ALL-MODULE-PATHinstead of naming a module. The module pathassembled here only ever holds JLine artifacts, so this works for both shapes
and needs no per-Scala-version logic; the Scala 2 and Scala 3 branches collapse
into one.
--enable-native-accessstill needs a real module name, picked fromwhether the split-out
jline-nativeartifact is present.Extracted as
jlineJavaOptsso it can be unit tested.