{"record":{"id":"010960bd3df6c4a2","repo":"quarkusio/quarkus","slug":"quarkus-applications-require-java-21-or-higher-to","errorCode":null,"errorMessage":"Quarkus applications require Java 21 or higher to build","messagePattern":"Quarkus applications require Java 21 or higher to build","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"critical","filePath":"core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java","lineNumber":103,"sourceCode":"        this.targetDir = builder.targetDir;\n        this.effectiveModel = builder.effectiveModel;\n        this.baseName = builder.baseName;\n        this.originalBaseName = builder.originalBaseName;\n        this.deploymentClassLoader = builder.deploymentClassLoader;\n        this.rebuild = builder.rebuild;\n        this.devModeType = builder.devModeType;\n        this.auxiliaryApplication = builder.auxiliaryApplication;\n        this.auxiliaryDevModeType = Optional.ofNullable(builder.auxiliaryDevModeType);\n        this.test = builder.test;\n        this.depInfoProvider = builder.depInfoProvider;\n        if (this.baseName != null) {\n            this.buildSystemProperties.put(\"quarkus.build.base-name\", baseName);\n        }\n    }\n\n    public BuildResult run() throws Exception {\n        if (!(Runtime.version().feature() >= 21)) {\n            throw new IllegalStateException(\"Quarkus applications require Java 21 or higher to build\");\n        }\n        long start = System.nanoTime();\n        log.debug(\"Beginning Quarkus augmentation\");\n        runtimeInitializeForAugmentation();\n        ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();\n        try (QuarkusBuildCloseablesBuildItem buildCloseables = new QuarkusBuildCloseablesBuildItem()) {\n            Thread.currentThread().setContextClassLoader(deploymentClassLoader);\n\n            BuildChainBuilder chainBuilder = BuildChain.builder();\n            chainBuilder.setClassLoader(deploymentClassLoader);\n\n            ExtensionLoader.loadStepsFrom(deploymentClassLoader, buildSystemProperties, runtimeProperties, effectiveModel,\n                    launchMode, devModeType).accept(chainBuilder);\n\n            Thread.currentThread().setContextClassLoader(classLoader);\n            chainBuilder.loadProviders(classLoader);\n\n            chainBuilder.addPriorityItem(LoggingSetupBuildItem.class);","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/deployment/src/main/java/io/quarkus/deployment/QuarkusAugmentor.java#L85-L121","documentation":"Quarkus augmentation requires at least Java 21; QuarkusAugmentor.run() checks Runtime.version().feature() before building and throws IllegalStateException on older JDKs. The framework itself is compiled for Java 21, so building an app with an older JVM cannot proceed.","triggerScenarios":"Running ./mvnw quarkus:build, quarkus:dev, or a test that invokes QuarkusAugmentor with JAVA_HOME pointing to a JDK older than 21.","commonSituations":"CI runner with an outdated default JDK; IDE configured with an old project JDK; JAVA_HOME pointing to JDK 17 after upgrading Quarkus (which raised the minimum from 17 to 21).","solutions":["Install JDK 21+ and set JAVA_HOME to it (e.g. export JAVA_HOME=/path/to/jdk-21).","In the IDE, set the project/Gradle/Maven JVM to 21+.","In CI, update the setup-java action or container image to JDK 21 (e.g. temurin:21)."],"exampleFix":"// before (CI)\njava-version: '17'\n// after\njava-version: '21'","handlingStrategy":"validation","validationCode":"if (Runtime.version().feature() < 21) {\n    throw new IllegalStateException(\"Java 21+ is required; current JDK: \" + Runtime.version());\n}","typeGuard":"static boolean isJava21Plus() {\n    return Runtime.version().feature() >= 21;\n}","tryCatchPattern":null,"preventionTips":["Pin JAVA_HOME to JDK 21+ in local shells, IDE settings, and CI images.","Use toolchains (maven-toolchains / Gradle toolchains) to enforce the JDK version.","Check the Quarkus version's minimum Java requirement after upgrades."],"tags":["jdk","version","build-environment","quarkus"],"backgroundTag":"unsupported-java-version","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"}