我尝试在我的项目中使用jmh1.25,其中依赖列表非常庞大。
Options opts = new OptionsBuilder().include(".*")
.warmupIterations(10)
.measurementIterations(10)
.mode(Mode.AverageTime)
.timeUnit(TimeUnit.NANOSECONDS).jvmArgs("-server")
.forks(1).resultFormat(ResultFormatType.TEXT).build();
new Runner(opts).run();
但是我有个错误:
<failed to invoke the VM, caught IOException: Cannot run program "C:\Program Files\Java\jdk-15\bin\java.exe":
CreateProcess error=206, The filename or extension is too long>
所以我按照建议使用了新的jvm参数jmh.separateclasspathjar:
.jvmArgs("-Djmh.separateClasspathJAR=true")
但是我又犯了一个错误:
Exception in thread "main" java.lang.IllegalArgumentException: 'other' has different root
所以我升级到jmh 1.27,但例外情况仍然存在:
<failed to invoke the VM, caught IOException: Cannot run program "C:\Program Files\Java\jdk-15\bin\java.exe":
CreateProcess error=206, The filename or extension is too long>
jmh日志:
# JMH version: 1.27
# VM version: JDK 15, Java HotSpot(TM) 64-Bit Server VM, 15+36-1562
# VM invoker: C:\Program Files\Java\jdk-15\bin\java.exe
# VM options: -Djmh.separateClasspathJAR=true
# JMH blackhole mode: full blackhole + dont-inline hint
暂无答案!
目前还没有任何答案,快来回答吧!