oracle/graal · error · RuntimeError

The SPECJVM2008 environment variable was not specified.

Error message

The SPECJVM2008 environment variable was not specified.

What it means

SPECjvm2008 suite validation failure. validateEnvironment() requires specJvmPath() to be resolvable, which reads the SPECJVM2008 environment variable pointing at a directory containing SPECjvm2008.jar. Without it the suite has no benchmark code to run.

Source

Thrown at sdk/mx.sdk/mx_sdk_benchmark.py:3260

            mx.abort("Please set the SPECJVM2008 environment variable to a " +
                     "SPECjvm2008 directory.")
        jarname = "SPECjvm2008.jar"
        jarpath = os.path.join(specjvm2008, jarname)
        if not os.path.exists(jarpath):
            mx.abort("The SPECJVM2008 environment variable points to a directory " +
                     "without the SPECjvm2008.jar file.")

        # copy to newly-created temporary working directory
        working_dir_jarpath =  os.path.abspath(os.path.join(self.workdir, jarname))
        if not os.path.exists(working_dir_jarpath):
            mx.log("copying " + specjvm2008 + " to " + self.workdir)
            shutil.copytree(specjvm2008, self.workdir, dirs_exist_ok=True)

        return working_dir_jarpath

    def validateEnvironment(self):
        if not self.specJvmPath():
            raise RuntimeError(
                "The SPECJVM2008 environment variable was not specified.")

    def validateReturnCode(self, retcode):
        return retcode == 0

    def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
        if benchmarks is None:
            # No benchmark specified in the command line, so run everything.
            benchmarks = self.benchmarkList(bmSuiteArgs)

        vmArgs = self.vmArgs(bmSuiteArgs)
        runArgs = self.runArgs(bmSuiteArgs)
        if "mpegaudio" in benchmarks:
            # GR-51015: run the benchmark on one thread
            # as a workaround for mpegaudio concurrency issues.
            mx.log("Setting benchmark threads to 1 due to race conditions in mpegaudio benchmark")
            runArgs += ["-bt", "1"]

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Download SPECjvm2008 and export SPECJVM2008=/path/to/specjvm2008 (directory containing SPECjvm2008.jar).
  2. Confirm the directory layout: $SPECJVM2008/SPECjvm2008.jar must exist (the jar name may need renaming from the distribution's name).
  3. For CI, gate SPECjvm2008 jobs on presence of the env var and skip otherwise.

Example fix

# before
mx benchmark specjvm2008:compress   # SPECJVM2008 unset -> RuntimeError

# after
export SPECJVM2008=/opt/benchmarks/specjvm2008
mx benchmark specjvm2008:compress
Defensive patterns

Strategy: validation

Validate before calling

import os, pathlib
p = os.environ.get("SPECJVM2008")
assert p and (pathlib.Path(p) / "SPECjvm2008.jar").exists(), (
    "SPECJVM2008 must point to a directory containing SPECjvm2008.jar")

Prevention

When it happens

Trigger: Running 'mx benchmark specjvm2008:...' without SPECJVM2008 exported, or with it set to an empty string.

Common situations: CI machines where the proprietary SPECjvm2008 archive is not installed; new developers who have not downloaded SPECjvm2008 (license-restricted, not distributed with mx).

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/e2ec3d43d07aa58b. Report an issue: GitHub.