Kotlin in Terminal


I introduce the way to use Kotlin in terminal. Thanks for that, we can use interpreter of Kotlin, which we can often see in LL.

The way I introduce can be used in system with Unix Base, also in OS X.

Environment

  • OS: Ubuntu
  • Kotlin: 1.2.0

Procedure

  1. Install SDKMAN!
    Command
    Output
  2. Install Kotlin compiler and interpreter.
    Command
    Output
  3. Make it available to use Kotlin. If you relaunch shell, you don’t have to execute the following command.
    Command

Kotlin Interpreter

With command kotlinc, you can launch Kotlin interpreter.

Example

When you end it, type :quit and enter key, or Ctrl + D.

kotlinc file_path.kts [args...] executes Kotlin script.