Download The Ultimate Tutorial: Getting Started With Kotlin

350 pages of hands-on tutorial right into your email inbox. Learn how to use state of the art development environment and build a full-fledged command-line application. You will receive free updates to the tutorial. Start learning Kotlin today!

Installing JDK on Linux

Looking for Mac OS X? Here is the link to the guide.

Looking for Windows? Here is the link to the guide.

OpenJDK​​​​

This tutorial assumes you have OpenJDK installed. Skip this section if you already have OpenJDK installed. Though, you might want to update the version of your OpenJDK if it is too old. Then continue reading.

To check if OpenJDK is installed and has proper version run the following command and it should produce the following output:

$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

Your openjdk version and other numbers may vary.

If you do not have OpenJDK installed, you will get an appropriate message in the terminal. To install it run the following command in the terminal:

For Debian-Based Systems (Ubuntu, Debian, etc.)

$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

For RHEL-Based Systems (Fedora, CentOS, Oracle Linux, Red Hat Enterprise Linux, etc.)

$ su -c "yum install java-1.8.0-openjdk"

This command will ask you for your password. Don’t worry – it will not appear on the screen when you will be typing. Finally, when the command execution is complete, you should run java -version and check that its output is similar to what we had a few paragraphs before.

You might need to update you OpenJDK version if it is too old. For that, you should execute the following command:

For Debian-Based Systems (Ubuntu, Debian, etc.) the same as for installation above:

$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk

For RHEL-Based Systems (Fedora, CentOS, Oracle Linux, Red Hat Enterprise Linux, etc.) different from the installation:

$ su -c "yum update java-1.8.0-openjdk"

Now you should be set to use JDK on Linux.

Check out my free Ultimate Tutorial: Getting Started With Kotlin where you will build a real command-line application while learning all the features of Kotlin you will need to construct 80% of any application.

Copyright ©iwillteachyoukotlin.com 2018 - Oleksii Fedorov