diff --git a/README.md b/README.md index cddf7493e1967..249964bcb8960 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ See our [web site](https://kafka.apache.org) for details on the project. You need to have [Java](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed. -Java 8 should be used for building in order to support both Java 8 and Java 11 at runtime. +We build and test Apache Kafka with Java 8, 11 and 14. We set the `release` parameter in javac and scalac +to `8` to ensure the generated binaries are compatible with Java 8 or higher (independently of the Java version +used for compilation). Scala 2.13 is used by default, see below for how to use a different Scala version or all of the supported Scala versions. diff --git a/build.gradle b/build.gradle index b8a88626f3900..696e1c4311e3c 100644 --- a/build.gradle +++ b/build.gradle @@ -501,6 +501,10 @@ subprojects { ] } + // Scalac's `-release` requires Java 9 or higher + if (JavaVersion.current().isJava9Compatible()) + scalaCompileOptions.additionalParameters += ["-release", minJavaVersion] + configure(scalaCompileOptions.forkOptions) { memoryMaximumSize = '1g' jvmArgs = ['-Xss4m'] diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index e38b14421643b..7993d123b8d3c 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -61,7 +61,7 @@ versions += [ bcpkix: "1.64", checkstyle: "8.20", commonsCli: "1.4", - gradle: "6.3", + gradle: "6.4", gradleVersionsPlugin: "0.28.0", grgit: "4.0.1", httpclient: "4.5.11", diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6623300bebd01..fd0c5a38e92dc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists