AW: Can't fork VM if option value contains space
Bernd Eckenfels
ecki at zusammenkunft.net
Tue Aug 12 10:51:39 UTC 2014
It us not meant as a solution for Windows. There is no useful semantics in the command parser of Windows, just dont use it for stuff like that. It should work on most shells (mac,linux)
having said that i somewhat wonder why the original syntax did not work on OSX, it should preserv blanks when passed on with the right process API and no "/bin/sh -c".
gruss
Bernd
--
http://bernd.eckenfels.net
----- Ursprüngliche Nachricht -----
Von: "vyazelenko at yahoo.com" <vyazelenko at yahoo.com>
Gesendet: 12.08.2014 12:24
An: "Bernd Eckenfels" <ecki at zusammenkunft.net>
Cc: "Aleksey Shipilev" <aleksey.shipilev at oracle.com>; "jmh-dev at openjdk.java.net" <jmh-dev at openjdk.java.net>
Betreff: Re: Can't fork VM if option value contains space
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