Passing jvmArgs with spaces?

Trask Stalnaker trask.stalnaker at gmail.com
Tue Mar 24 03:42:43 UTC 2015


Strangely this is working for me on windows but not on linux:

java -jar benchmarks.jar -jvmArgs "-Dx=12 \"-Dy=one two\""

On Windows:

# JMH 1.7 (released 3 days ago)
# VM invoker: C:\dev\java\jre1.8.0_40\bin\java.exe
# VM options: -Dx=12 "-Dy=one two"

and the benchmark succeeds.

While on Linux:

# JMH 1.7 (released 3 days ago)
# VM invoker: /usr/lib/jvm/java-8-oracle/jre/bin/java
# VM options: -Dx=12 "-Dy=one two"

and the benchmark fails with

Error: Could not find or load main class "-Dy=one

Thanks,
Trask


More information about the jmh-dev mailing list