How to Install Ballerina Lang on Manjaro Linux

Mayura Andrew,BallerinaManjaroLinuxInstallationProgramming

Knowlihub

Ballerina (opens in a new tab) is a modern programming language designed for cloud-era application development. While Manjaro users can use the AUR, installing Ballerina manually from the official binary zip gives you more control and ensures you always get the latest release.

Prerequisite Software

Java

Before installing Ballerina, ensure your system has the following software installed:

Setting the JAVA_HOME environment variable correctly is essential for Ballerina to locate the Java runtime.

With these prerequisites in place, you can proceed with downloading and installing Ballerina on your Manjaro system.

Step 1: Download the Ballerina Binary

Go to the official Ballerina downloads page (opens in a new tab) and download the latest Linux .zip distribution.

Step 2: Extract the Zip File

Open your terminal and navigate to your Downloads folder. Extract the zip file:

unzip ballerina-*.zip

Step 3: Move the Extracted Folder

Move the extracted folder to a system location, such as /usr/lib/ballerina:

sudo mv ballerina-* /usr/lib/ballerina

Step 4: Set Up Environment Variables

Add Ballerina to your PATH and set the JAVA_HOME variable. Edit your shell config file (~/.bashrc or ~/.zshrc):

export PATH=$PATH:/usr/lib/ballerina/bin
export JAVA_HOME=/usr/lib/jvm/default
export PATH=$JAVA_HOME/bin:$PATH

To edit your shell config file, use the following command to open it in a text editor from your home directory:

For Bash:

cd ~
nano .bashrc

For Zsh:

cd ~
nano .zshrc

This will open the file in the nano editor, allowing you to add the required environment variable lines. After saving, reload your shell with:

source ~/.bashrc

or

source ~/.zshrc

Step 5: Verify the Installation

Check that Ballerina is installed and JAVA_HOME is set:

bal version

output

output If the version is displayed, you are ready to start building with Ballerina!