It would be great if sbt-jmh included a workaround for running with long classpaths on Windows.
Currently JMH is failing to fork benchmarks and prints:
<failed to invoke the VM, caught IOException: Cannot run program "C:\Program Files\Java\...\java.exe":
CreateProcess error=206, The filename or extension is too long>
This can be worked around by adding this to my sbt configuration:
Jmh / run / javaOptions ++= (
if (System.getProperty("os.name").startsWith("Windows")) {
Seq("-Djmh.separateClasspathJAR=true", "\"-Djava.io.tmpdir=" + target.value + "\"")
} else
Seq.empty
),
It would be great if sbt-jmh included a workaround for running with long classpaths on Windows. Currently JMH is failing to fork benchmarks and prints:
This can be worked around by adding this to my sbt configuration:
-Djmh.separateClasspathJAR=true
tells JMH to package classpath into JAR file. Setting-Djava.io.tmpdir=
is required if source files aren't on the same drive as temp directory - https://github.com/openjdk/jmh/blob/1.37/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java#L874.