# Building a Native Binary for Apache Kafka on macOS

DevFeed: [Building a Native Binary for Apache Kafka on macOS](<https://devfeed.tech/articles/building-a-native-binary-for-apache-kafka-on-macos-18802.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/building-native-binary-for-apache-kafka-macos/>)

Published: 2025-04-07T10:25:00Z

Content type: tutorial

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Kafka](<https://devfeed.tech/topics/kafka.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Development](<https://devfeed.tech/topics/development.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [apache-kafka](<https://devfeed.tech/tags/apache-kafka.md>), [building](<https://devfeed.tech/tags/building.md>), [development](<https://devfeed.tech/tags/development.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [macos](<https://devfeed.tech/tags/macos.md>), [native](<https://devfeed.tech/tags/native.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This tutorial explains how to build a self-contained native Apache Kafka binary for macOS using GraalVM and the configuration and tooling from Kafka's native container-image work. It covers obtaining the Kafka distribution, using the provided native-image configuration, and producing a macOS/AArch64 executable for development and testing.

## Source excerpt

Table of Contents KIP-974: Docker Image for GraalVM based Native Kafka Broker With help of the GraalVM configuration developed for KIP-974 (Docker Image for GraalVM based Native Kafka Broker), you can easily build a self-contained native binary for Apache Kafka. Read on to learn how you can build a native Kafka executable yourself, starting in milli-seconds, making it a perfect fit for development and testing purposes. When I wrote about ahead-of-time class loading and linking in Java 24 recently, I also published the start-up time for Apache Kafka as a native binary for comparison. This was done via Docker, as there's no pre-built native binary of Kafka available for the operating system I'm running on, macOS. But there is a native Kafka container image, so this is what I chose for the sake of convenience. Now, running in a container adds a little bit of overhead of course, so it wasn't a surprise when Thomas Würthinger, lead of the GraalVM project at Oracle, brought up the question what the value would be when running Kafka natively on macOS. Needless to say I can't leave this kind of nice nerd snipe pass, so I set out to learn how to build a native Kafka binary on macOS, using GraalVM.