Closed gwinstanley closed 3 years ago
You can add jvm arguments that way:
jmhRunBytecodeGenerator {
getJvmArgs().add("--enable-preview")
}
(I didn't test that exactly, but that works for incubator modules at least)
@SirYwell Problem solved; many thanks.
The suggested answer didn't work for me, the problem was in the compileJmhJava
task also,
compileJmhJava {
options.compilerArgs += ['--enable-preview', '--add-modules', 'jdk.incubator.vector']
}
jmhRunBytecodeGenerator {
jvmArgs.add '--add-modules=jdk.incubator.vector'
}
Describe the bug When trying to benchmark code making use of JDK preview features, the plugin fails due to the byte code generator being called without the appropriate JVM arguments being applied.
To Reproduce Steps to reproduce the behavior:
The compile tasks & jmh DSL section configured including these:
The resulting error is predictably relating to class version, which implies the JVM arguments configured in the DSL are not being applied to the byte code generator JVM when it is forked: