Fix illegal reflective access warning on JDK 11 (fixes #12167)#12339
Merged
Conversation
Set org.jline.terminal.exec.redirectPipeCreationMode=native in launcher scripts to prevent JLine's ExecTerminalProvider from using reflection to access ProcessBuilder$RedirectPipeImpl. This avoids the "WARNING: Illegal reflective access" messages that appear on JDK 9-15 when stdout is redirected (e.g. piped or written to a file). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep reflection as a fallback for platforms where the native JNI implementation may not be available. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
confirm, my test: |
slawekjaranowski
approved these changes
Jun 22, 2026
cstamas
approved these changes
Jun 22, 2026
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.
Summary
org.jline.terminal.exec.redirectPipeCreationMode=nativein bothmvnandmvn.cmdlauncher scripts to prevent JLine'sExecTerminalProviderfrom using reflection to accessProcessBuilder$RedirectPipeImplmvn -v | catormvn -v > file.txt)The property is a JLine 3.x configuration knob (see jline/jline3#951) that switches pipe creation from reflection-based to native (JNI), which is already available since Maven ships
jline-terminal-jniand sets-Dlibrary.jline.path.Fixes #12167
Test plan
mvn -v | catno longer prints the "Illegal reflective access" warningmvn -vstill works (property is harmless — exec provider falls back)🤖 Generated with Claude Code
Claude Code on behalf of Guillaume Nodet