{"record":{"id":"dbbddff2670924cc","repo":"quarkusio/quarkus","slug":"the-project-is-built-with-java-17-or-higher-but-t","errorCode":null,"errorMessage":"The project is built with Java 17 or higher, but the selected Dockerfile (%s) is using a lower Java version in the base image (%s). Please ensure you are using the proper base image in the Dockerfile.","messagePattern":"The project is built with Java 17 or higher, but the selected Dockerfile \\((.+?)\\) is using a lower Java version in the base image \\((.+?)\\)\\. Please ensure you are using the proper base image in the Dockerfile\\.","errorType":"console","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"extensions/container-image/container-image-docker-common/deployment/src/main/java/io/quarkus/container/image/docker/common/deployment/CommonProcessor.java","lineNumber":83,"sourceCode":"            PackageConfig packageConfig,\n            ContainerRuntime... containerRuntimes) {\n\n        var buildContainerImage = buildContainerImageNeeded(containerImageConfig, buildRequest);\n        var pushContainerImage = pushContainerImageNeeded(containerImageConfig, pushRequest);\n\n        if (buildContainerImage || pushContainerImage) {\n            if (!containerRuntimeStatusBuildItem.isContainerRuntimeAvailable()) {\n                throw new RuntimeException(\n                        \"Unable to build container image. Please check your %s installation.\"\n                                .formatted(getProcessorImplementation()));\n            }\n\n            var dockerfilePaths = getDockerfilePaths(config, false, packageConfig, out);\n            var dockerfileBaseInformation = DockerFileBaseInformationProvider.impl()\n                    .determine(dockerfilePaths.dockerfilePath());\n\n            if (dockerfileBaseInformation.isPresent() && (dockerfileBaseInformation.get().javaVersion() < 17)) {\n                throw new IllegalStateException(\n                        \"The project is built with Java 17 or higher, but the selected Dockerfile (%s) is using a lower Java version in the base image (%s). Please ensure you are using the proper base image in the Dockerfile.\"\n                                .formatted(\n                                        dockerfilePaths.dockerfilePath().toAbsolutePath(),\n                                        dockerfileBaseInformation.get().baseImage()));\n            }\n\n            if (buildContainerImage) {\n                LOGGER.infof(\"Starting (local) container image build for jar using %s\", getProcessorImplementation());\n            }\n\n            var executableName = getExecutableName(config, containerRuntimes);\n            var builtContainerImage = createContainerImage(containerImageConfig, config, containerImageInfo, out,\n                    dockerfilePaths, buildContainerImage, pushContainerImage, packageConfig, executableName);\n\n            Optional<BuiltContainerInfo> maybeBuiltContainerInfo = determineBuiltContainerInfo(executableName,\n                    builtContainerImage);\n            String workingDirectory = null;\n            if (maybeBuiltContainerInfo.isPresent()) {","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/container-image/container-image-docker-common/deployment/src/main/java/io/quarkus/container/image/docker/common/deployment/CommonProcessor.java#L65-L101","documentation":"Quarkus requires Java 17+ since recent versions. When building a JVM container image, it parses the FROM line of the selected Dockerfile to determine the base image's Java version; if the base image provides Java < 17 the container would fail to run the application, so the build aborts with this IllegalStateException.","triggerScenarios":"Building a container image from a jar where src/main/docker/Dockerfile.jvm (or the configured quarkus.container-image.docker.dockerfile-jvm-path) uses an old base image such as registry.access.redhat.com/ubi8/openjdk-11 or eclipse-temurin:11.","commonSituations":"Projects upgraded from Quarkus 2.x to 3.x but keeping the old generated Dockerfiles; custom Dockerfiles pinned to Java 11; registry mirrors still serving an old tag.","solutions":["Update the FROM line in the Dockerfile to a Java 17+ base image (e.g. eclipse-temurin:17, registry.access.redhat.com/ubi8/openjdk-17)","Regenerate the default Dockerfiles from a new Quarkus project (src/main/docker/Dockerfile.jvm)","If you intentionally use a custom Dockerfile, ensure its base image tag corresponds to Java 17 or higher","Verify with 'docker run --rm <base-image> java -version'"],"exampleFix":"# before\nFROM registry.access.redhat.com/ubi8/openjdk-11:1.14\n# after\nFROM registry.access.redhat.com/ubi8/openjdk-17:1.16","handlingStrategy":"validation","validationCode":"String dockerfile = Files.readString(Path.of(\"src/main/docker/Dockerfile.jvm\"));\nString from = Arrays.stream(dockerfile.split(\"\\n\"))\n        .filter(l -> l.strip().startsWith(\"FROM\")).findFirst().orElse(\"\");\nif (from.matches(\".*(openjdk-1[01]|:1[01]|java-11).*\")) {\n    throw new IllegalStateException(\"Base image is below Java 17: \" + from.strip());\n}","typeGuard":"boolean isJava17BaseImage(String dockerfileContent) {\n    return dockerfileContent.lines()\n        .filter(l -> l.strip().toUpperCase().startsWith(\"FROM\"))\n        .noneMatch(l -> l.matches(\".*\\\\b(jdk-?1[01]|openjdk-1[01]|:11|:17?)\\\\s*$\".replace(\"17?\", \"\"))\n            && !l.contains(\"17\") && !l.contains(\"21\"));\n}","tryCatchPattern":"try {\n    imageBuild();\n} catch (IllegalStateException e) {\n    if (e.getMessage().contains(\"lower Java version\")) {\n        // update FROM line to a Java 17+ base image and retry\n    } else throw e;\n}","preventionTips":["Regenerate src/main/docker Dockerfiles when upgrading Quarkus major versions","Pin base images to Java 17+ tags (openjdk-17, temurin:17, java17)","Check 'docker run <base> java -version' before adopting a base image","Search CI logs for the 'lower Java version' message after Quarkus 3 upgrades"],"tags":["docker","java-version","base-image","quarkus-3"],"backgroundTag":"base-image-java-version-mismatch","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}