This page explains how to get the software you need to use on Linux or macOS for local development.
java 21
package or newergit
installeddocker
installed
Note: For contribution, you must have a
github
account.
- Install
OpenJDK 21
package or newer:
sudo apt update
sudo apt install openjdk-21-jdk
- Check java version using the command
java -version
.
openjdk version "21.0.5" 2024-10-15
OpenJDK Runtime Environment (build 21.0.5+8-Ubuntu-2ubuntu120.04)
OpenJDK 64-Bit Server VM (build 21.0.5+8-Ubuntu-2ubuntu120.04, mixed mode, sharing)
Note: In case OpenJDK 21 is not set as your default Java, run sudo update-alternatives --config java
command to list all installed Java versions.
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/java-16-openjdk-amd64/bin/java 1051 manual mode
3 /usr/lib/jvm/java-17-openjdk-amd64/bin/java 1021 manual mode
4 /usr/lib/jvm/java-21-openjdk-amd64/bin/java 1001 manual mode
Press <enter> to keep the current choice[*], or type selection number:
you can set it as the default by entering the selection number for it in the list and pressing Enter. For example, to set Java 21 as the default, you would enter "4" and press Enter.
- Install
git
:
sudo apt install git
- Install
docker
:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt -y install docker-ce
To execute the docker
Command without sudo
:
sudo usermod -aG docker ${USER}
su - ${USER}
sudo chmod 666 /var/run/docker.sock
- Install brew.
- Install brew cask:
brew cask
- Install openjdk 21 via Homebrew:
brew install openjdk@21
- Verify Installation
java -version
Note: In case OpenJDK 21 is not set as your default Java, you can consider including it in your $PATH
after installation
export PATH="$(/usr/libexec/java_home -v 21)/bin:$PATH"
export JAVA_HOME="$(/usr/libexec/java_home -v 21)"
If java_home doesn't recognize homebrew installed java you can run below cmd to symlink brew installed java path to jvm
sudo ln -sfn $(brew --prefix openjdk@21)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk
Consider allocating not less than 4GB of memory for your docker. Otherwise, some apps within a stack (e.g. kafbat-ui.yaml
) might crash.
To check how much memory is allocated to docker, use docker info
.
You will find the total memory and used memory in the output. if you won't find used memory that means memory limits are not set for containers.
To allocate 4GB of memory for Docker:
MacOS
Edit docker daemon settings within docker dashboard
For Ubuntu
- Open the Docker configuration file in a text editor using the following command:
sudo nano /etc/default/docker
- Add the following line to the file to allocate 4GB of memory to Docker:
DOCKER_OPTS="--default-ulimit memlock=-1:-1 --memory=4g --memory-swap=-1"
- Save the file and exit the text editor.
- Restart the Docker service using the following command:
sudo service docker restart
- Verify that the memory limit has been set correctly by running the following command:
docker info | grep -i memory
Note that the warning messages are expected as they relate to the kernel not supporting cgroup memory limits.
Now any containers you run in docker will be limited to this amount of memory. You can also increase the memory limit as per your preference.
In the next section, you'll learn how to Build and Run kafbat-ui.