在安装完jmh后运行报错Unable to find the resource:/META-INF/BenchmarkList

因为jmh用到了APT(Annotation Processing Tool) ,所以需要配置IDE

IDEA中安装Jmh Plugin

然后在Build,Extension,Deployment->Compiler->Annotation Processors中勾选Enable

同时保证依赖jmh-generator-annprocess

dependencies {
    compile group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.21'
    compile group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.21'
}

如果还有问题,可以检查

将Build & Run设置为IDEA即可

说点什么
支持Markdown语法
好耶,沙发还空着ヾ(≧▽≦*)o
Loading...