Setting classpath with benchmark.java
Aleksey Shipilev
shade at redhat.com
Wed Sep 26 14:33:53 UTC 2018
On 09/12/2018 06:48 PM, Alan Burlison wrote:
> I'm trying to run a benchmark which needs a specific classpath setting, to include a library that
> isn't available via Maven.
>
> Unfortunately it seems to be impossible to set the classpath with jmh. I'm using "-jvmArgs
> '-Djava.class.path=/opt/instantclient/ojdbc8.jar" to try to do so but here's the resulting
> command-line that's used to run the target VM by benchmark.java:
It is not possible to combine runnable JAR and classpath settings. It is possible to improve JMH to
accept classpath parameter, but the usual workflow is to make every library available via the build
system (whether it is Maven or Gradle) and shaded into the final benchmark. This also explains why
this is not a showstopper for most users.
-Aleksey
More information about the jmh-dev
mailing list