Setup

We will be building Kotlin applications and services, and using the Java JDK as our deployment target. This means that you need to install the Java JDK and the Kotlin compiler on your development machine. It’s also highly recommended that you install the Intelli IDEA IDE for working with Kotlin, as it offers advanced language support and integrated well with our other tools and libraries1.

Check the Course-Project/Technologies page for the recommended version numbers. Also, make sure that you and your team all install the same distribution and versions of these tools!

The following represents the minimum toolchain for the course.

Git

We use Git for version control, so you will need Git installed to perform operations on your source code.

Git is pre-installed on macOS and Linux; Windows users can install it from https://git-scm.org. Once it’s installed, you may need to update your path to include the Git installation directory. You can check your installation using the git version command.

❯ git version
git version 2.37.1 (Apple Git-137.1)

Java JDK

  • Download and install the JDK from Azul or OpenJDK (make sure to match your system architecture).
  • Add JAVA_HOME to your system’s environment variables, pointing to this installation.
  • Update your path to include the directory containing the Java executables.

For example, I am using JDK 18 (at the time I’m writing this). I have the following lines in my .zshrc:

export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-18.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin

You can check your installation using the java version command. Make sure the version matches what you expected to see.

$ java -version
openjdk version "18.0.2.1" 2022-08-18
OpenJDK Runtime Environment Zulu18.32+13-CA (build 18.0.2.1+1)
OpenJDK 64-Bit Server VM Zulu18.32+13-CA (build 18.0.2.1+1, mixed mode, sharing)

IntelliJ IDEA

IntelliJ IDEA is our recommended development environment. You can install it from https://www.jetbrains.com/idea/download/.

There is an Open Source Community version which will work for this course. There is also an Ultimate license, which includes better support for databases, web services and other frameworks that we’ll be using. This is normally a paid upgrade, but as a student you can get a free license2 to most of thier products, including this version of IntelliJ IDEA.

You can check the installed version by opening IntelliJ IDEA and looking at the IntelliJ IDEA - About dialog.

About Dialog

Kotlin

We will need a Kotlin compiler, and the Kotlin standard libraries. IntelliJ IDEA includes a Kotlin plugin, so if you have installed IntelliJ IDEA and you are working from the IDE, then you do not need to install Kotlin.

However, if you wish to compile from the command-line, or use a different editor, then you will need to install Kotlin manually. It can be installed from https://www.kotlinlang.org or from most package managers (e.g. brew install kotlin if you are a Mac user with Homebrew installed).

If you install the command-line version, you can check your installation using the kotlin -version command.

❯ kotlinc -version
info: kotlinc-jvm 1.8.20 (JRE 18.0.2.1+1)
Info

There are other libraries that are suggested on the Course-Project/Technologies page e.g. Ktor, Exposed, JUnit. You do NOT need to manually install any of these! Early in the course we will discuss Gradle, our build system, which has the ability to import these libraries into our project automatically. It’s much easier than trying to manually manage all of the dependencies!

As long as you have installed Git, Java/JVM, Kotlin, and have an editor/IDE setup, you can start working on your project.


  1. Kotlin is supported in other editors, but make sure to install the appropriate language plugins for Kotlin, and Gradle. ↩︎

  2. https://www.jetbrains.com/community/education/#students ↩︎