<div dir="ltr"><div id="gmail-:fg3" class="gmail-Am gmail-aiL gmail-Al editable gmail-LW-avf gmail-tS-tW gmail-tS-tY" aria-label="Message Body" role="textbox" aria-multiline="true" style="direction:ltr;min-height:85px" tabindex="1" aria-controls=":jze" aria-expanded="false"><div dir="auto"><div>Hi Kirk,</div><div><br></div><div>I don't think it is the shell that is splitting the value as the jvmArgs is quoted, I think it is when the argument is parsed.</div><div>I tried \ escaping the spaces as well. </div><div><br></div><div>java -jar build/libs/jmh-spaces-bug-reproduction-jmh.jar \<br>  -jvmArgs "-javaagent:/tmp/agent with spaces/dummy.jar"<br><br>java -jar build/libs/jmh-spaces-bug-reproduction-jmh.jar \<br>  -jvmArgs "-javaagent:/tmp/agent\ with\ spaces/dummy.jar"<br></div><div><br></div><div>I can see the the description of the flag suggest it is a space space-separated line, which makes me think this is intended behaviour, however, I cannot understand how a value containing spaces can then be used:</div><div><br></div><div>  -jvmArgs <string>           Use given JVM arguments. Most options are inherited <br>                              from the host VM options, but in some cases you want <br>                              to pass the options only to a forked VM. Either single <br>                              space-separated option line, or multiple options <br>                              are accepted. This option only affects forked runs. </div><div><br></div><div><br></div><div>Dires.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 14 Aug 2025, 8:08 am Kirk Pepperdine, <<a href="mailto:kirk.pepperdine@gmail.com" target="_blank">kirk.pepperdine@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi Dries,<div><br></div><div>Have you tried escaping the spaces to that the shell doesn’t split the value?</div><div><br></div><div>Kind regards,</div><div>Kirk</div><div><br id="m_2471096448246977460m_6990176735298610484lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Aug 13, 2025, at 7:59 PM, Dries Samyn <<a href="mailto:mail@dries.net" rel="noreferrer" target="_blank">mail@dries.net</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr"><div>I'm not sure this is considered a bug as it matches the documented behaviour, but I can't think of a clean workaround if it is.</div><div><br></div><div>I
 believe arguments passed into the -jvmArgs option are space delimited. 
However, this is problematic when those arguments include spaces as part
 of the value.</div><div>For example, I am trying to create a 
custom profiler for YourKit integration, but the YourKit agent, by 
default, has spaces in its path on MacOs, which means trying to pass it 
in the jvmArgs option is problematic.</div><div><br></div><div>I have created a reproduction of the issue and explanation here: <a href="https://github.com/driessamyn/jmh-spaces-bug-reproduction" rel="noreferrer" target="_blank">https://github.com/driessamyn/<span>jmh</span>-spaces-bug-reproduction</a></div><div><br></div><div>Looking forward to hearing thoughts on this.</div><font color="#888888"><div><br></div><div>Dries.</div></font></div><br></div>
</div></blockquote></div><br></div></div></blockquote></div></div></div>
</div><br></div>