oracle/graal · error · IllegalArgumentException

Versions must not be negative.

Error message

Versions must not be negative.

What it means

Error "Versions must not be negative." thrown in oracle/graal.

Source

Thrown at sdk/src/org.graalvm.home/src/org/graalvm/home/Version.java:394

    }

    /**
     * Constructs a new GraalVM version from a list of version numbers. The versions must not be
     * <code>null</code> and none of the version numbers must be negative. At least one version
     * number must be non-zero.
     *
     * @see #compareTo(int...)
     * @since 19.3
     */
    public static Version create(int... versions) throws IllegalArgumentException {
        Objects.requireNonNull(versions);
        int[] useVersions = trimTrailingZeros(versions);
        if (useVersions.length == 0) {
            throw new IllegalArgumentException("At least one non-zero version must be specified.");
        }
        for (int i = 0; i < useVersions.length; i++) {
            if (useVersions[i] < 0) {
                throw new IllegalArgumentException("Versions must not be negative.");
            }
        }
        return new Version(useVersions);
    }

    /**
     * Returns the current GraalVM version of the installed component. Never <code>null</code>.
     *
     * @see HomeFinder#getVersion()
     * @since 19.3
     */
    public static Version getCurrent() {
        return parse(HomeFinder.getInstance().getVersion());
    }

}

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Fix the condition reported by the error: Versions must not be negative.
  2. Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call.

Example fix

Validate inputs and environment so that the failing condition does not occur: Versions must not be negative.

When it happens

Trigger: Thrown at sdk/src/org.graalvm.home/src/org/graalvm/home/Version.java:394 when the library encounters an invalid state.

Common situations: Occurs when a caller violates the contract guarded by this check: Versions must not be negative.


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