How to install kotlin programming language on Ubuntu/Debian Linux

How do I install the latest version of kotlin programming language on Ubuntu or Debian Linux system?

Kotlin is a free and open source statically-typed programming language. It runs on the JVM, and one can compile to JavaScript source code. Kotlin is similar to Apple’s Swift. One can write server-side or Android apps in it. This page shows you how to install the latest version of Kotlin programming language on on Ubuntu or Debian Linux.

Install kotlin using the Software Development Kit (SDK) manager

Type the following command to install sdk:
$ wget -O ""
$ vi
$ bash

Sample outputs:

Fig.01: Installing SDKMAN

Type the following commands to install kotlin:
$ source ~/.sdkman/bin/
$ sdk install kotlin

Sample outputs:

Fig.02: Installing kotline

Install JDK

Type the following command :
$ sudo apt-get install openjdk-8-jre-headless
Sample outputs:

[sudo] password for vivek: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.10.0-19 linux-headers-4.10.0-19-generic linux-image-4.10.0-19-generic linux-image-extra-4.10.0-19-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  ca-certificates-java java-common
Suggested packages:
  default-jre fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho ttf-wqy-microhei | ttf-wqy-zenhei fonts-indic
The following NEW packages will be installed:
  ca-certificates-java java-common openjdk-8-jre-headless
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.7 MB of archives.
After this operation, 102 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 zesty/main amd64 ca-certificates-java all 20161107 [12.6 kB]
Get:2 zesty/main amd64 

Write your first kotlin program

Create a file called hello.kt:
$ vi hello.kt
Append the following code:

fun main(args: Array<String>) {
    println("Hello, World!")

Save and close the file. Compile your app into jar:
$ kotlinc hello.kt -include-runtime -d hello.jar
Run your app:
$ java -jar hello.jar
Sample outputs:

Fig.03: Running your first app

For more info see

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.