Search code examples
javabashshellbenchmarking

SPECjvm: How to execute outside installation folder


I want to do benchmarking using SPECjvm.

The SPECjvm user guide states

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.

And it works by doing so, e.g.:

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

Yet I would like to execute SPECjvm benchmarks independent of the shell's current location, e.g.:

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

Does anyone here have experience with SPECjvm who could tell me if there is a possibility to achieve this, e.g. by setting the classpath, a command-line parameter or something similar?


Solution

  • In this case, you must set the specjvm home to your install directory

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

    The documenatation states the following:

    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