{"record":{"id":"d779d7c77cb4af3e","repo":"quarkusio/quarkus","slug":"cannot-parse-version-from-output-stringoutput","errorCode":null,"errorMessage":"Cannot parse version from output: \n${stringOutput}","messagePattern":"Cannot parse version from output: \n(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java","lineNumber":307,"sourceCode":"\n        public boolean jdkVersionGreaterOrEqualTo(String version) {\n            return javaVersion.compareToIgnoreOptional(Runtime.Version.parse(version)) >= 0;\n        }\n\n        public static Version of(Stream<String> output) {\n            String stringOutput = output.collect(Collectors.joining(\"\\n\"));\n            List<String> lines = stringOutput.lines()\n                    .dropWhile(l -> !l.startsWith(\"GraalVM\") && !l.startsWith(\"native-image\"))\n                    .toList();\n\n            if (lines.size() == 3) {\n                Version parsedVersion = VersionParseHelper.parse(lines);\n                if (parsedVersion != VersionParseHelper.UNKNOWN_VERSION) {\n                    return parsedVersion;\n                }\n            }\n\n            throw new IllegalArgumentException(\n                    \"Cannot parse version from output: \\n\" + stringOutput);\n        }\n\n    }\n}\n","sourceCodeStart":289,"sourceCodeEnd":313,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/GraalVM.java#L289-L313","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the echoed stringOutput in the message to see what the binary actually printed.","Point quarkus.native.builder-image (or GRAALVM_HOME) at a GraalVM/Mandrel version supported by your Quarkus release.","Run the binary manually with --version to confirm it outputs a standard version line.","Remove wrapper scripts/exports that print banners (e.g. SDKMAN init output, MOTD) before the version.","Upgrade Quarkus if your GraalVM/Mandrel release is newer than what this Quarkus version supports."],"exampleFix":"# before\nquarkus.native.builder-image=quay.io/my-custom-image:latest\n# after\nquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:22.3-java17","handlingStrategy":"validation","validationCode":"// Validate your native-image toolchain before building\nString version = System.getenv(\"GRAALVM_HOME\") == null ? null\n        : ProcessHandle.class == null ? null : null;\n// Simpler: run the binary yourself and check output\n// $GRAALVM_HOME/bin/native-image --version   # must print e.g. 'native-image 22.3.0'\n// or for containers:\n// docker run <builder-image> --version","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin a supported builder image: quay.io/quarkus/ubi-quarkus-native-image:<version>.","Match GraalVM/Mandrel version to your Quarkus release matrix.","Run --version manually before a long native build.","Avoid wrapper scripts that print banners before tool output."],"tags":["native-image","graalvm","version-parsing"],"backgroundTag":"graalvm-version-detection-failed","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}