You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Maven 4 does not start when JAVA_TOOL_OPTIONS is set and the project has .mvn/jvm.config #13405
Maven 4 does not start when the project has .mvn/jvm.config and any of JAVA_TOOL_OPTIONS, _JAVA_OPTIONS or JDK_JAVA_OPTIONS is set. Maven 3.9.16 and 3.10.0 build the same project.
$ cat .mvn/jvm.config
-Xmx512m
$ JAVA_TOOL_OPTIONS=-Dfoo=bar mvn -o validate
Picked up JAVA_TOOL_OPTIONS: -Dfoo=bar
Error: Could not find or load main class Picked
Caused by: java.lang.ClassNotFoundException: Picked
With JDK_JAVA_OPTIONS the class is NOTE:, from the JVM's NOTE: Picked up JDK_JAVA_OPTIONS line. The exit code is 1.
concat_lines in bin/mvn (line 402 on master, 208 on maven-4.0.x) has captured the output of JvmConfigParser.java with 2>&1 since #11365. The JVM that runs the parser prints its "Picked up …" notice on stderr, so the notice becomes part of the JVM options, and its first word is taken as the main class. JAVA_TOOL_OPTIONS is common on CI runners and in containers, and invoker-based integration tests set it to tune the forked JVMs.
Capturing only stdout would fix it, with stderr shown only when the parser exits non-zero. I have not checked mvn.cmd.
Hi, I'd like to work on this issue. I'll investigate the output capture in bin/mvn and look into adding a regression test for the JAVA_TOOL_OPTIONS case. Please let me know if anyone is already working on a fix. Thank you!
I have investigated the issue and opened PR #13447 with the fix in bin/mvn along with a regression test. Feedback is welcome when you have a moment. Thank you!
Activity
Yashisinghal285 commentedon Oct 12, 2026
Hi, I'd like to work on this issue. I'll investigate the output capture in
bin/mvnand look into adding a regression test for theJAVA_TOOL_OPTIONScase. Please let me know if anyone is already working on a fix. Thank you!Yashisinghal285 commentedon Oct 12, 2026
I have investigated the issue and opened PR #13447 with the fix in
bin/mvnalong with a regression test. Feedback is welcome when you have a moment. Thank you!Fix apache#13405: Do not capture JVM stderr notices into jvm.config o…
[Backport maven-4.0.x] Fix #13405: Do not capture JVM stderr notices …