From 5b4c082486b7915ece4b137dcb82f4b67eec0fd5 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Mon, 22 Jun 2026 17:50:30 +0200 Subject: [PATCH 1/2] [ISSUE-12167] Fix illegal reflective access warning on JDK 11 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 --- apache-maven/src/bin/mvn | 1 + apache-maven/src/bin/mvn.cmd | 1 + 2 files changed, 2 insertions(+) diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index 02c7ddd75228..e4e6d86a1b9d 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -212,5 +212,6 @@ exec "$JAVACMD" \ "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \ "-Dmaven.home=${MAVEN_HOME}" \ "-Dlibrary.jline.path=${MAVEN_HOME}/lib/jline-native" \ + "-Dorg.jline.terminal.exec.redirectPipeCreationMode=native" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${CLASSWORLDS_LAUNCHER} ${MAVEN_ARGS} "$@" diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd index bf6b152f2f4d..4995373dd752 100644 --- a/apache-maven/src/bin/mvn.cmd +++ b/apache-maven/src/bin/mvn.cmd @@ -191,6 +191,7 @@ set "INTERNAL_MAVEN_OPTS=--enable-native-access=ALL-UNNAMED %INTERNAL_MAVEN_OPTS "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^ "-Dmaven.home=%MAVEN_HOME%" ^ "-Dlibrary.jline.path=%MAVEN_HOME%\lib\jline-native" ^ + "-Dorg.jline.terminal.exec.redirectPipeCreationMode=native" ^ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ %CLASSWORLDS_LAUNCHER% %MAVEN_ARGS% %MAVEN_CMD_LINE_ARGS% if ERRORLEVEL 1 goto error From 194678aeeb1caeefc0e2c8ed8e147522489241bd Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Mon, 22 Jun 2026 17:52:51 +0200 Subject: [PATCH 2/2] Use native,reflection fallback order for redirectPipeCreationMode Keep reflection as a fallback for platforms where the native JNI implementation may not be available. Co-Authored-By: Claude Opus 4.6 --- apache-maven/src/bin/mvn | 2 +- apache-maven/src/bin/mvn.cmd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index e4e6d86a1b9d..2b3dc375fc86 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -212,6 +212,6 @@ exec "$JAVACMD" \ "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \ "-Dmaven.home=${MAVEN_HOME}" \ "-Dlibrary.jline.path=${MAVEN_HOME}/lib/jline-native" \ - "-Dorg.jline.terminal.exec.redirectPipeCreationMode=native" \ + "-Dorg.jline.terminal.exec.redirectPipeCreationMode=native,reflection" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${CLASSWORLDS_LAUNCHER} ${MAVEN_ARGS} "$@" diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd index 4995373dd752..417161e978ee 100644 --- a/apache-maven/src/bin/mvn.cmd +++ b/apache-maven/src/bin/mvn.cmd @@ -191,7 +191,7 @@ set "INTERNAL_MAVEN_OPTS=--enable-native-access=ALL-UNNAMED %INTERNAL_MAVEN_OPTS "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^ "-Dmaven.home=%MAVEN_HOME%" ^ "-Dlibrary.jline.path=%MAVEN_HOME%\lib\jline-native" ^ - "-Dorg.jline.terminal.exec.redirectPipeCreationMode=native" ^ + "-Dorg.jline.terminal.exec.redirectPipeCreationMode=native,reflection" ^ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ %CLASSWORLDS_LAUNCHER% %MAVEN_ARGS% %MAVEN_CMD_LINE_ARGS% if ERRORLEVEL 1 goto error