SPECjvm:如何在安装文件夹外执行

SPECjvm: How to execute outside installation folder

我想使用 SPECjvm 进行基准测试。

The SPECjvm user guide

It should be executed from a shell or command window and should be executed where the benchmark is installed, where the SPECjvm2008.jar file is located.

这样做是有效的,例如:

user@pc:~/util/SPECjvm2008$ java -jar /home/user/util/SPECjvm2008/SPECjvm2008.jar

然而我想独立于 shell 的当前位置执行 SPECjvm 基准测试,例如:

user@pc:~/somewhere/else$ java -jar /home/user/util/SPECjvm2008/SPECjvm2008.jar

这里有没有人有 SPECjvm 的经验谁可以告诉我是否有可能实现这一目标,例如通过设置类路径、命令行参数或类似的东西?

在这种情况下,您必须将 specjvm 主页设置为您的安装目录

-Dspecjvm.home.dir=foo/bar/baz

The documenatation 声明如下:

SPECjvm2008 can be run from any directory; however, specjvm.home.dir must be specified as a system property and point to the SPECjvm2008 location (where SPECjvm2008.jar is located). Example:

java -Dspecjvm.home.dir=/home/tests/SPECjvm2008 -jar /home/tests/SPECjvm2008/SPECjvm2008.jar

In the above example, the results will be produced where you execute, but can be controlled with property specjvm.result.dir. Example:

java -Dspecjvm.home.dir=/home/tests/SPECjvm2008 -Dspecjvm.result.dir=/home/results/jvm08-results/ -jar /home/tests/SPECjvm2008/SPECjvm2008.jar