Install Kotlin Programming Language on Linux Mint | Ubuntu

In today’s guide we will walk you through the steps to install Kotlin Programming Language on Linux Mint | Ubuntu. Kotlin is an elegant, highly concise, fluent, and expressive statically typed multi-paradigm language that compiles down to both Java bytecode and JavaScript.

Kotlin ca be used to build front-end, server-side, and Android applications. Kotlin is designed to interoperate with Java and is fully supported on the Android operating system by Google. For sure Kotlin is a modern approach to object-oriented programming (OOP). If you have Java development experience mastering Kotlin language basics and progressing through actual applications building to running on the JVM and Android devices should take short time.

Install Kotlin Programming Language on Linux Mint | Ubuntu

There are multiple options available to you for installing Kotlin Programming Language on Linux Mint | Ubuntu. All the methods should work just fine without any tweaks and hacks.

The common methods of installing Kotlin Programming Language on Linux Mint | Ubuntu are:

  • Installation of Kotlin on Ubuntu | Linux Mint using SDKMAN
  • Installation of Kotlin on Ubuntu | Linux Mint using a Snap package
  • Building Kotlin from source

We will use the first two methods to install Kotlin Programming Language on Linux Mint | Ubuntu.

Method 1: Install Kotlin Programming Language on Linux Mint | Ubuntu using SDKMAN

SDKMAN is a command line tool that allows you to manage multiple versions of your Software Development Kits in parallel on most Unix based systems. Aside from the Command Line Interface(CLI) an API is available for installing, switching, removing and listing Candidates.

Install dependencies:

sudo apt install curl unzip zip

Install Java:

sudo apt install openjdk-17-jre-headless

To install SDKMAN tool run the following commands in your terminal.

curl -s "https://get.sdkman.io" | bash

This script should work on Linux, macOS, WSL, Solaris, Cygwin, and on a FreeBSD system. Below is my command execution output:

cloudspinx@ubuntu-noble:~$ curl -s "https://get.sdkman.io" | bash

                                -+syyyyyyys:
                            `/yho:`       -yd.
                         `/yh/`             +m.
                       .oho.                 hy                          .`
                     .sh/`                   :N`                `-/o`  `+dyyo:.
                   .yh:`                     `M-          `-/osysoym  :hs` `-+sys:      hhyssssssssy+
                 .sh:`                       `N:          ms/-``  yy.yh-      -hy.    `.N-````````+N.
               `od/`                         `N-       -/oM-      ddd+`     `sd:     hNNm        -N:
              :do`                           .M.       dMMM-     `ms.      /d+`     `NMMs       `do
            .yy-                             :N`    ```mMMM.      -      -hy.       /MMM:       yh
          `+d+`           `:/oo/`       `-/osyh/ossssssdNMM`           .sh:         yMMN`      /m.
         -dh-           :ymNMMMMy  `-/shmNm-`:N/-.``   `.sN            /N-         `NMMy      .m/
       `oNs`          -hysosmMMMMydmNmds+-.:ohm           :             sd`        :MMM/      yy
      .hN+           /d:    -MMMmhs/-.`   .MMMh   .ss+-                 `yy`       sMMN`     :N.
     :mN/           `N/     `o/-`         :MMMo   +MMMN-         .`      `ds       mMMh      do
    /NN/            `N+....--:/+oooosooo+:sMMM:   hMMMM:        `my       .m+     -MMM+     :N.
   /NMo              -+ooooo+/:-....`...:+hNMN.  `NMMMd`        .MM/       -m:    oMMN.     hs
  -NMd`                                    :mm   -MMMm- .s/     -MMm.       /m-   mMMd     -N.
 `mMM/                                      .-   /MMh. -dMo     -MMMy        od. .MMMs..---yh
 +MMM.                                           sNo`.sNMM+     :MMMM/        sh`+MMMNmNm+++-
 mMMM-                                           /--ohmMMM+     :MMMMm.       `hyymmmdddo
 MMMMh.                  ````                  `-+yy/`yMMM/     :MMMMMy       -sm:.``..-:-.`
 dMMMMmo-.``````..-:/osyhddddho.           `+shdh+.   hMMM:     :MmMMMM/   ./yy/` `:sys+/+sh/
 .dMMMMMMmdddddmmNMMMNNNNNMMMMMs           sNdo-      dMMM-  `-/yd/MMMMm-:sy+.   :hs-      /N`
  `/ymNNNNNNNmmdys+/::----/dMMm:          +m-         mMMM+ohmo/.` sMMMMdo-    .om:       `sh
     `.-----+/.`       `.-+hh/`         `od.          NMMNmds/     `mmy:`     +mMy      `:yy.
           /moyso+//+ossso:.           .yy`          `dy+:`         ..       :MMMN+---/oys:
         /+m:  `.-:::-`               /d+                                    +MMMMMMMNh:`
        +MN/                        -yh.                                     `+hddhy+.
       /MM+                       .sh:
      :NMo                      -sh/
     -NMs                    `/yy:
    .NMy                  `:sh+.
   `mMm`               ./yds-
  `dMMMmyo:-.````.-:oymNy:`
  +NMMMMMMMMMMMMMMMMms:`
    -+shmNMMMNmdy+:`


                                                                 Now attempting installation...


Looking for a previous installation of SDKMAN...
Looking for unzip...
Looking for zip...
Looking for tar...
Looking for curl...
Looking for sed...
Installing SDKMAN scripts...
Create distribution directories...
Getting available candidates...
Prime platform file...
Prime the config file...
Installing script cli archive...
* Downloading...
######################################################################## 100.0%
* Checking archive integrity...
* Extracting archive...
* Copying archive contents...
* Cleaning up...

Installing script cli archive...
* Downloading...
######################################################################## 100.0%
* Checking archive integrity...
* Extracting archive...
* Copying archive contents...
* Cleaning up...

Set version to 5.19.0 ...
Set native version to 0.7.4 ...
Attempt update of interactive bash profile on regular UNIX...
Added sdkman init snippet to /home/cloudspinx/.bashrc
Attempt update of zsh profile...
Updated existing /home/cloudspinx/.zshrc



All done!


You are subscribed to the STABLE channel.

Please open a new terminal, or run the following in the existing one:

    source "/home/cloudspinx/.sdkman/bin/sdkman-init.sh"

Then issue the following command:

    sdk help

Enjoy!!!

You’ll need to source the shell environment to activate.

$ source "$HOME/.sdkman/bin/sdkman-init.sh"

The sdk command should be available for use in your shell environment.

$ sdk version
SDKMAN!
script: 5.19.0
native: 0.7.4 (linux x86_64)

The next step is to open your terminal and install Kotlin with sdk command:

sdk install kotlin

Be patient as the installation may take some minutes.

Downloading: kotlin 2.1.21

In progress...

##############################################################################################################################100.0%

Installing: kotlin 2.1.21
Done installing!


Setting kotlin 2.1.21 as default.

Checking Kotlin version installed.

$ kotlin -version
Kotlin version 2.1.21-release-317 (JRE 17.0.15+6-Ubuntu-0ubuntu124.04)

After the installation you can start its interactive shell.

Method 2: Install Kotlin Programming Language on Linux Mint | Ubuntu from Snap

Kotlin can also be installed on Ubuntu | Linux Mint Linux from a Snap package. Snap is already installed on Ubuntu 16.04+ systems.

If you machine doesn’t have snapd install with the below commands:

sudo apt update
sudo apt install snapd

Once snap has been installed use the commands below to get Kotlin Programming Language on Linux Mint | Ubuntu from Snap:

sudo snap install --classic kotlin

Output:

Testing Kotlin with Hello World Program

Now that we’ve installed Kotlin on Linux Mint and Ubuntu system let’s create a simple application in Kotlin that displays “Hello, World!” message.

tee hello-world.kt <<EOF
fun main() {
    println("Hello, World!")
}
EOF

Kotlin programs need to be compiled using the Kotlin compiler before execution.

kotlinc hello-world.kt -include-runtime -d hello-world.jar

This generated .jar application which you can run with:

$ java -jar hello-world.jar
Hello, World!

There you go!. You’ve successfully install and tested Kotlin Programming Language on Ubuntu / Linux Mint. We also have an article on the top recommended Kotlin books.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Did you get an error message “error while loading shared libraries: libpng16.so.16: cannot open shared object file” while trying to […]

Bauh is a graphical interface for managing Linux applications/ packages. It currently supports Arch (repositories/AUR), AppImage, Snap, Flatpak and native […]

Performing regular backups of your files in Linux operating systems is a critical part of personal data security and overall […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.