Does Kafka support java 10 or java 11?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Apache Kafka, a distributed event streaming platform, is built on the Scala programming language and is widely used for handling real-time data feeds. Kafka's compatibility with Java versions is crucial because Java is the primary runtime environment due to its JVM (Java Virtual Machine) compatibility. Understanding whether Kafka supports Java 10 or Java 11 is important for developers and enterprises aiming to integrate or upgrade their Kafka installations with the latest Java offerings.
Java Versions and Kafka
Apache Kafka, since its inception, has traditionally aligned its compatibility to support long-term supported (LTS) Java versions because these versions typically get support and updates over a longer period, making them reliable for enterprise applications. Java 8 has been the platform's primary development and runtime JDK (Java Development Kit) for several years.
Support for Java 11
With the release of Java 11 in September 2018, which is an LTS version, there was a significant interest from the Kafka community to upgrade the Java version that Kafka supports. By Kafka version 2.1.0, released in November 2018, the Apache Kafka team officially added support for Java 11. This allowed developers to leverage Java 11’s improved features such as enhanced performance and security while using Kafka.
The support for Java 11 was not without challenges, as it necessitated adjustments in Kafka’s internal use of JVM features and APIs that had been updated or deprecated in the newer Java version. Some of these include updates in garbage collection logging, handling of reflection, and use of newer Java Platform Module System (JPMS) introduced in Java 9.
Java 10 Support
Java 10, being a non-LTS version with a relatively shorter support lifecycle, did not receive official support from the Kafka project. It was released in March 2018 and was superseded by Java 11 within six months. Given the non-LTS status and rapid supersession by Java 11, focusing on Java 10 did not align with Kafka's typical approach to support only LTS versions due to concerns over long-term stability and maintenance.
Technical Example: Running Kafka with Java 11
To run Kafka with Java 11, you may need to adjust Java Virtual Machine (JVM) parameters to optimize performance and adapt to the idiosyncrasies of the newer Java version. Below is a basic example of JVM options you might consider when running Kafka under Java 11:
This configuration sets the heap size and selects the G1 garbage collector, which is generally seen as a good default for Java 11 especially with high-throughput applications like Kafka.
Summary Table: Kafka and Java Versions
| Java Version | Kafka Compatibility | Release Year | LTS Status | Notes |
| Java 8 | Yes | 2014 | Yes | Primary development platform for Kafka. |
| Java 10 | No | 2018 | No | Short-term version, quickly superseded by Java 11. |
| Java 11 | Yes | 2018 | Yes | Supported from Kafka 2.1.0 onwards. Offers numerous JVM improvements over Java 8. |
Conclusion
In conclusion, Kafka supports Java 11, aligning with its LTS status and offering enhanced features and performance optimizations. Java 10, however, lacks official support from the Kafka project, highlighting the project’s focus on stability and extended support periods beneficial for enterprise users. Developers planning to use Kafka are encouraged to use Java 11 to take advantage of modern Java features while ensuring compatibility with the latest stable versions of Kafka.
Related reading
- Does Kafka support priority for topic or message?
- Does Kafka support request response messaging
- Does Kafka support secure communication?
- Does Kafka supports XA transactions?
- Does Netty violate the contract of Future.cancel... method?
- Does spring boot support using both properties and yml files at the same time?
- Does Kafka's message include timestamp by default?
- Does min insync replicas property effects consumers in kafka

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.