{"record":{"id":"5fd744ebc30e0764","repo":"apache/iceberg","slug":"releases-must-be-built-with-java-17","errorCode":null,"errorMessage":"Releases must be built with Java 17","messagePattern":"Releases must be built with Java 17","errorType":"console","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"deploy.gradle","lineNumber":21,"sourceCode":" * or more contributor license agreements.  See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership.  The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License.  You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied.  See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nif (project.hasProperty('release') && jdkVersion != '17') {\n  throw new GradleException(\"Releases must be built with Java 17\")\n}\n\nsubprojects {\n  def isBom = it.name == 'iceberg-bom'\n  def isOpenApi = it.name == 'iceberg-open-api'\n\n  apply plugin: 'maven-publish'\n  apply plugin: 'signing'\n  afterEvaluate {\n\n    if (!isBom) {\n      task sourceJar(type: Jar, dependsOn: classes) {\n        archiveClassifier.set('sources')\n        from sourceSets.main.allSource\n        group 'build'\n      }\n\n      task javadocJar(type: Jar, dependsOn: javadoc) {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/deploy.gradle#L3-L39","documentation":"deploy.gradle enforces that release builds (invoked with the 'release' project property) run on JDK 17. Iceberg's signing/publish toolchain requires Java 17; building a release with any other JDK would produce artifacts outside the supported/reproducible toolchain, so the script fails fast with this GradleException.","triggerScenarios":"Running a Gradle invocation that includes the 'release' property (e.g. ./gradlew -Prelease assemble or the release workflow) while the configured toolchain JDK (jdkVersion) is anything other than 17.","commonSituations":"Local machine defaults to JDK 11 or JDK 21 via JAVA_HOME; CI runner image upgraded to a newer JDK; developer runs the release task without setting org.gradle.java.home or the toolchain property.","solutions":["Build with JDK 17: point JAVA_HOME (or org.gradle.java.home in gradle.properties) at a JDK 17 installation.","If you are not doing an official release, drop the -Prelease flag from the Gradle command.","On CI, use a JDK 17 setup action (e.g. actions/setup-java with distribution and java-version: 17)."],"exampleFix":"// before\n./gradlew -Prelease assemble   # JAVA_HOME=jdk-21\n// after\nexport JAVA_HOME=/usr/lib/jvm/jdk-17\n./gradlew -Prelease assemble","handlingStrategy":"validation","validationCode":"test \"$(java -version 2>&1 | head -1)\" = *\"version \\\"17\"* || echo 'Release builds need JDK 17'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin JAVA_HOME to JDK 17 in release scripts and CI release workflows.","Only pass -Prelease on release builds.","Check ./gradlew -q javaToolchains or java -version before tagging a release."],"tags":["gradle","jdk","release-build","environment"],"backgroundTag":"unsupported-platform","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}