quarkusio/quarkus · error · IllegalArgumentException

Cannot parse version from output: ${stringOutput}

Error message

Cannot parse version from output: 
${stringOutput}

What it means

GraalVM.of() runs the native-image/graalvm binary with --version and parses the output with VersionParseHelper. If the process output contains no recognizable version line, this IllegalArgumentException is thrown so the build fails early instead of mis-detecting native-image capabilities.

Source

Thrown at core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java:307

        public boolean jdkVersionGreaterOrEqualTo(String version) {
            return javaVersion.compareToIgnoreOptional(Runtime.Version.parse(version)) >= 0;
        }

        public static Version of(Stream<String> output) {
            String stringOutput = output.collect(Collectors.joining("\n"));
            List<String> lines = stringOutput.lines()
                    .dropWhile(l -> !l.startsWith("GraalVM") && !l.startsWith("native-image"))
                    .toList();

            if (lines.size() == 3) {
                Version parsedVersion = VersionParseHelper.parse(lines);
                if (parsedVersion != VersionParseHelper.UNKNOWN_VERSION) {
                    return parsedVersion;
                }
            }

            throw new IllegalArgumentException(
                    "Cannot parse version from output: \n" + stringOutput);
        }

    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Check the echoed stringOutput in the message to see what the binary actually printed.
  2. Point quarkus.native.builder-image (or GRAALVM_HOME) at a GraalVM/Mandrel version supported by your Quarkus release.
  3. Run the binary manually with --version to confirm it outputs a standard version line.
  4. Remove wrapper scripts/exports that print banners (e.g. SDKMAN init output, MOTD) before the version.
  5. Upgrade Quarkus if your GraalVM/Mandrel release is newer than what this Quarkus version supports.

Example fix

# before
quarkus.native.builder-image=quay.io/my-custom-image:latest
# after
quarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:22.3-java17
Defensive patterns

Strategy: validation

Validate before calling

// Validate your native-image toolchain before building
String version = System.getenv("GRAALVM_HOME") == null ? null
        : ProcessHandle.class == null ? null : null;
// Simpler: run the binary yourself and check output
// $GRAALVM_HOME/bin/native-image --version   # must print e.g. 'native-image 22.3.0'
// or for containers:
// docker run <builder-image> --version

Prevention

When it happens

Trigger: Native image build config points at a binary whose --version output is unrecognized: a very old/new GraalVM release, a non-GraalVM binary (e.g. plain java), a wrapper script printing extra banners, or localized output.

Common situations: GRAALVM_HOME or quarkus.native.builder-image misconfigured; Mandrel vs GraalVM distribution differences; corporate wrappers printing warnings before the version line; unsupported/pre-release GraalVM version newer than the Quarkus release.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/d779d7c77cb4af3e. Report an issue: GitHub.