While setting up Kotlin using InteliJ is much simpler, then I have observed that many persons search of how to set up Kotlin in Eclipse and gradle. There is nothing complicated in it.

At first take a look at official site:


There is a plugin available for Eclipse to use Kotlin.


Setup Kotlin using Gradle

First of all there is need to add gradle plugin and it’s definition to build.gradle file.

buildscript {
    repositories {

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-2"


Next, just use this plugin in gradle:

apply plugin: 'kotlin'


There also need to be compiler options defined:

compileKotlin {
        kotlinOptions {
            jvmTarget = "1.8"
            apiVersion = proj.ext.kotlinApiVersion
            languageVersion = proj.ext.kotlinApiVersion


Dependencies are also very important:

dependencies {
        compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
        compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"


Most probably you will want to mix it with java, so it’s better to set up it properly also:

apply plugin: 'java'

sourceCompatibility = 1.8
targetCompatibility = 1.8

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'




Setup Kotlin using Gradle

Do you like Kotlin?

Thank you for the vote!