Download The Ultimate Tutorial: Getting Started With Kotlin

350 pages of hands-on tutorial right into your email inbox. Learn how to use state of the art development environment and build a full-fledged command-line application. You will receive free updates to the tutorial. Start learning Kotlin today!

Installing JDK on Mac OS X

Looking for Linux? Here is the link to the guide.

Looking for Windows? Here is the link to the guide.


This tutorial assumes you have homebrew installed. Skip this section if you already have homebrew installed.

To check if homebrew is installed run the following command, and it should produce the following output:

$ brew --version
Homebrew 1.3.2
Homebrew/homebrew-core (git revision 44a0; last commit 2017-09-19)

Your version, git revision and last commit is going to vary.

However, if you see something like that:

$ brew --version
zsh: command not found: brew

Then that means you do not have homebrew installed. Follow instructions at the official homebrew website to install it.


To check if JDK of proper version is installed run the following command and it should produce the following output:

$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

You java version and other numbers may vary.

If you do not have JDK installed, this command should trigger a dialog window with instructions how to install JDK by downloading it from some website. Ignore this and just press OK. Since you have homebrew installed, you should run in your terminal:

$ brew update
$ brew tap caskroom/versions
$ brew cask install java8

This command should ask you for your account’s password, that is correct. When it prompts for the password:

Enter your password:

Then you should enter your password. Don’t worry – it will not appear on the screen when you will be typing. Finally, when the command execution is complete, you should run java -version and check that its output is similar to what we had a few paragraphs before.

You might need to update your JDK version if it is too old. For that, you should execute the following two commands: brew update and brew cask reinstall java8

Now you should be set to use JDK on Mac OS X.

Check out my free Ultimate Tutorial: Getting Started With Kotlin where you will build a real command-line application while learning all the features of Kotlin you will need to construct 80% of any application.

Copyright © 2018 - Oleksii Fedorov