Can't fork VM if option value contains space

vyazelenko at yahoo.com vyazelenko at yahoo.com
Tue Aug 12 10:24:29 UTC 2014


The solution from Bernd with single quotes around entire property does not work (at least on Windows), because entire thing is passed as String:
    VM options: '-Dmy.prop=A B C'
Note also that double quotes are gone.

@Aleksey:
- Original issue described is reproducible on Windows and Mac OS X. Try to pass property via -jvmArgs instead of passing it directly to java launcher.
- Quoting the quotes, i.e.:
    -jvmArgs -Dmy.prop="\"A B C\""
Works on Windows but fails on Mac OS X.
- Using runner API just works. :)

Best regards,
Dmitry

Sent from my iPhone

> On Aug 12, 2014, at 1:45, Bernd Eckenfels <ecki at zusammenkunft.net> wrote:
> 
> Am Tue, 12 Aug 2014 03:22:16 +0400
> schrieb Aleksey Shipilev <aleksey.shipilev at oracle.com>:
>> ...this points to the shell escaping troubles in your shell, when you
>> pass the command line. Try to meddle with escaping both quotes and the
>> backslashes? E.g.:
>> 
>> java -jar target/benchmarks.jar -jvmArgs -Dmy.property=\\\"A B C\\\"
> 
> Or try this: java -jar target/benchmarks.jar -jvmArgs '-Dmy.property="A
> B C"'
> 
> Gruss
> Bernd


More information about the jmh-dev mailing list