Project creation

Project creation

To generate a Kotlin project with Gradle:

$ mkdir kotlin-gradle-demo \
    && cd kotlin-gradle-demo \
    && gradle init \
        --type kotlin-application \
        --dsl kotlin \
        --project-name kotlin-gradle-demo \
        --package fr.emse.tb3pwme
Note
You can also use the kotlin-library type.

You can also generate a Kotlin project with Maven:

$ mvn archetype:generate \
    -DgroupId=fr.emse.tb3pwme \
    -DartifactId=kotlin-maven-demo \
    -DarchetypeGroupId=org.jetbrains.kotlin \
    -DarchetypeArtifactId=kotlin-archetype-jvm \
    -DinteractiveMode=false

Also, the playground is a great place to test and tinker with Kotlin syntax.

kotlin playground