oracle/graal · error · IllegalArgumentException

Cannot downgrade from minimum required version

Error message

Cannot downgrade from minimum required version 

What it means

GraphOutput.Builder negotiates the graph-dumping protocol version. Once a minimum version has been required (by builder features such as pool-methods or dump-properties support), protocolVersion() rejects any request below that minimum with IllegalArgumentException. The message prints the minimum as (-major) + '.' + minor because the stored 'major' is negative while only a floor is set — the intent is 'cannot go below the required floor'.

Source

Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/graphio/GraphOutput.java:196

         * changed to other known versions manually by calling this method.
         * <p>
         * Note: the default version is 7.0 since version 20.2. Previous versions used default
         * version 4.0
         *
         * @param majorVersion by default 7, newer version may be known
         * @param minorVersion usually 0
         * @return this builder
         * @since 0.28
         */
        public Builder<G, N, M> protocolVersion(int majorVersion, int minorVersion) {
            assert majorVersion >= 1 : "Major must be positive";
            assert minorVersion >= 0 : "Minor must not be negative";

            if (!(explicitVersionSet ||
                            (majorVersion == 0) ||
                            (majorVersion > major) ||
                            ((majorVersion == major) && (minorVersion >= minor)))) {
                throw new IllegalArgumentException("Cannot downgrade from minimum required version " + (-major) + "." + minor);
            }
            this.major = majorVersion;
            this.minor = minorVersion;
            explicitVersionSet = true;
            return this;
        }

        /**
         * Asserts a specific version of the protocol. If not specified explicitly, upgrades the
         * protocol version.
         *
         * @param reqMajor The required major version
         * @param reqMinor the required minor version
         */
        private void requireVersion(int reqMajor, int reqMinor) {
            assert reqMajor >= 1 : "Major must be positive";
            assert reqMinor >= 0 : "Minor must not be negative";
            if (explicitVersionSet) {

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Raise the pinned version to at least the required minimum (the failing message tells you the floor).
  2. Remove the explicit protocolVersion() call and let the builder auto-upgrade to the highest mutually supported version.
  3. Set the version first, before adding features that requireVersion(), so the floor is not raised behind your back.
  4. Pair the change with a matching IGV/tooling version that understands the newer protocol.

Example fix

// before
GraphOutput.Builder b = new GraphOutput.Builder<>(...).withPoolSupport(...);
b.protocolVersion(5, 0); // IllegalArgumentException: below required floor

// after
b.protocolVersion(6, 0); // meet the floor, or drop the call entirely
Defensive patterns

Strategy: validation

Validate before calling

// Do not pin below the floor your builder features impose; simplest safe policy is no pin at all:
GraphOutput<G, N, M> out = new GraphOutput.Builder<G, N, M>(sparseCloneTable, blocksTable, typesTable, methodsTable)
        .build(); // auto-upgrades as features require

Try / catch

try {
    builder.protocolVersion(major, minor);
} catch (IllegalArgumentException e) {
    // e.getMessage() names the required floor; adopt it or drop the pin
    builder.protocolVersion(Integer.parseInt(e.getMessage().replaceAll("[^0-9.].*", "").split("\\.")[0]), 0);
}

Prevention

When it happens

Trigger: Calling builder.protocolVersion(m, n) with a version lower than one already required by earlier builder configuration, or calling protocolVersion twice with a descending second value after an explicit set. Using a pre-configured builder (e.g. one that already required version 6+ for .withPoolSupport or similar) and then pinning 5.0.

Common situations: Integrating GraphOutput with an older Ideal Graph Visualizer (IGV) and pinning a low protocol version, while the surrounding setup code already demanded a newer one. Copying version-pinning snippets between projects with different library versions. Upgrading the compiler library, which raises the internal minimum, without updating the pinned version.

Related errors


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