How to install Kotlin on Ubuntu 17.04

Kotlin

During the last Google I / O, Google has clearly indicated that Java will no longer be Android's main programming language for give way to other languages ​​like Python or Kotlin. Installing Python in Ubuntu is unnecessary since it already comes in the Ubuntu distribution, but And kotlin? How can Kotlin be installed on Ubuntu? Is it easy to do?

Kotlin can not only be installed on Windows or macOS but it can also be installed on UNIX-based operating systems, including Ubuntu and derivatives.

Kotlin is a free programming language available through the official website of the project. For this we only have to download the latest version of Kotlin and unzip it in our Ubuntu. It is a simple process, but when compiling it can cause problems. Thus, it is best to opt for the installation scripts. We just have to open the terminal and write the following:

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

And then, perform the installation with the following command:

sdk install kotlin

Now, we already have the Kotlin language in our Ubuntu. But is that all?

How to create a program in Kotlin

The truth is that no. This will allow us compile Kotlin code but not create files. To create files we can use code editors or directly an IDE that we can install in Ubuntu. Once we have written the code, we save it with extension .kt and we open a terminal in the same location as the created file. Now, in the terminal we write:

kotlinc ARCHIVO-CODIGO.kt -include-runtime -d ARCHIVO-CODIGO.jar

Ubuntu will compile the file and create an executable file that uses the Java virtual machine, something we already have installed in Ubuntu. So, thanks to these simple steps, we can install and run any code written for the Kotlin language. If we use Android Studio, Kotlin installation is even easier because we just have to search for the corresponding plugin and install it through the Google IDE.


Leave a Comment

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

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Jimmy olano said

    Okay, I do not understand the article, first you say this (I quote):

    "During the last Google I / O, Google has clearly indicated that Java will stop being the main programming language of Android to give way to other languages ​​such as Python or Kotlin."

    And then you say this (I quote):

    "Ubuntu will compile the file and create an executable file that uses the Java virtual machine, something we already have installed in Ubuntu."

    Please could you help me in my confusion? Thanks!

    1.    Pepito Love said

      Java is a language, whose code is compiled to run on the java virtual machine. Kotlin is another language with different characteristics that is also compiled to run on the Java virtual machine.
      There are three concepts: Java virtual machine, Java language and Ktolin language