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 Windows

Looking for Mac OS X? Here is the link to the guide.

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


This tutorial will require you to run some command-line programs in BASH. If you already have some BASH emulator installed and comfortable using it, feel free to skip this section.

Git BASH is one of the best BASH emulators for Windows.

Git BASH is included in Git for Windows. Go over there and download Git for Windows. Then launch the downloaded installer program.

When Windows asks you for the permission to install this software, answer “Yes”:

​When the setup program launches it will ask you if you accept the GNU GPL v2 license. Press “Next” to accept it and proceed with the installation:

Next step is to choose the location where you want to install Git for Windows. The default option should be good enough. If you have a preference of where to install programming tools, feel free to customize the installation directory:

Press “Next” to proceed. Now, you will need to select components that you want to install. The default selection should be good to go:

Let’s press the “Next” button to proceed. This step is about start menu folder. The default setting should do the trick:

Now, press “Next” to continue. On this screen, you will be able to choose how exactly Git is going to be installed on your Windows. The safest option is to go for “Use Git from Git Bash only”:

Press the “Next” button to continue. The next screen is about choosing whether you want to use OpenSSL or Windows Secure Channel Library. It does not matter for our purposes. The default option should do the trick:

At this point, click on that “Next” button to proceed. The next screen lets you configure how line endings should be handled (CRLF vs. LF). The default recommended option should do:

Hit that “Next” button to continue. That is a lot of steps. I know, right. The next screen lets you choose between two terminal emulation settings. The default option should work just fine:

After clicking on the “Next” button, you will see some extra settings. Default settings should do the trick:

That was the last step. Let’s hit that “Install” button. Finally! You should see the installing progress now:

After the installation is done, you should see the final screen indicating that installation was a success:

​After closing the installation window using that “Finish” button, we need to check if Git BASH works as expected. Let’s launch Git BASH application (from the start menu or “Search Windows”).

When launched you should see a terminal window like this:

Once you have launched the terminal emulator verify that it works by typing the following command and pressing Enter:

$ echo "Hello, World."

$ is not part of the command – it is just a prompt that terminal application usually outputs. No need to type it. Same applies for any terminal command I ask you to run in this tutorial. If that worked, you should see Hello, World. output like that:

$ echo "Hello, World."
Hello, World.


This tutorial assumes you have OpenJDK installed. Skip this section if you already have OpenJDK installed. Though, you might want to update the version of your OpenJDK if it is too old. Then continue reading.

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

$ java -version
openjdk version "1.8.0_141-1-ojdkbuild"
OpenJDK Runtime Environment (build 1.8.0_141-1-ojdkbuild-b16)
OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)

Your openjdk version and other numbers may vary.

If you get something like:

bash: java: command not found

That means that you do not have OpenJDK installed. To install it go to the ojkbuild open-source community page and download a suitable .msi installer for OpenJDK 1.8.* version for your Windows.

For example, if you have 64-bit Windows installed, you should use this link to download it:

When the download is finished, launch the installer. Because this is an open-source community build it is probably not signed with some official developer certificates, so you’ll get a message similar to this:

Run this setup anyway. In Windows 10 you will need to press “More info” link and the button “Run anyway” will appear:

After running the setup anyway, you should see a welcome screen of the installer:

After pressing the “Next” button you will be presented with the license agreement:

After accepting the license and pressing the “Next” button you should see the screen with the custom setup. Here you can select the components that are going to be installed. You can choose a custom install location, as well, if you so choose:

The default option for components should be just fine. The location should be just fine too. But if you want to customize it – go for it. Press the “Next” button when you are done.

At this point, we should be ready to start the installation. Hit that “Install” button now:

Right as the installation begins, your Windows will probably ask you whether you want to allow this program to be installed:

Again, because this is an open-source community it does not have a registered publisher (opened issue). Allow the installation. You should see an installation progress right after that:

When the installation is done, you should see a final screen of the setup wizard indicating a successful installation:

Press “Finish” to close the installer.

Now you want to verify that the installation was successful and you have a correct version of the OpenJDK installed. For that close and re-open Git BASH.

Then type the same command again: $ java -version. You should see the output like that:

openjdk version "1.8.0_141-1-ojdkbuild"
OpenJDK Runtime Environment (build 1.8.0_141-1-ojdkbuild-b16)
OpenJDK 64-Bit Server VM (build 25.141-b16, mixed mode)

If you need to update the OpenJDK version, repeat the process and make sure you download the latest available version from the ojdkbuild open-source community page.

Now you should be set to use JDK on Windows.

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