Install Java on Windows

Java is one of the most favorite programming language used by millions of applications and programs today. Java runs on various platforms like Windows, Unix, and mac os. It is very essential to understand how to install Java.

In this tutorial, I will be showing how to install Java on a Windows machine. The very first step is to download it from the official website.


  • First of all, download the latest version of Java from the official oracle site link.
  • Apparently, you need to choose the OS type and architecture (32 or 64 bit). If you are using windows 64 bit, then download JDK for Windows x64.
  • Note: this single setup contains both JDK and JRE (Java Runtime Environment), so it is not required to explicitly download JRE 8. JDK download and installation is sufficient.
  • Choosing the default location for installation, and you will get the following folder under C:\Windows\Program Files\Java.

Java installation - Liferay 7 installation

Set Java Home (Install Java)

Once Java is installed, you need to add a new environment variable called JAVA_HOME and update the PATH variable with Java home. Below are the steps.

  • Open the explorer, right-clicks on This PC, and click on Properties. You will see the below screenshot.

Set environment variable -Install Java

  • Click on the Advanced system settings link from the left-end side. You will see the below screen.

Set environment variable - Install Java

  • Click on Environment Variables.. button, and you will see windows like the below screenshot.

Set environment variable - Install Java

  • The upper section defines the variables available to the current window user only. The lower section shows the variables available to all users.
  • Click on New.. button from the lower section and add entries like the below screenshot.

Set environment variable - Install Java

  • Give variable name as JAVA_HOME and its value as the path of your JDK folder (you have two folders under C:\Program File\Java, you need to choose the JDK folder).
  • Note: I have 1.8.0_60, but you may have updated a minor version.

Update Path environment variable

Next is to update the Path environment variable. Below are the steps.

  • Select Path from the lower section and click on the Edit button. You will see new windows.

Set environment variable - Install Java

  • Click on the New button, and you will see a new blank entry. Just add %JAVA_HOME%\bin there. Click on the OK button.
  • Again click on the OK button.
  • Open command prompt and type java -version. If you see the output like the below screenshot, it means Java 8 is installed and configured properly.

Verify if Java 8 is installed - Install Java

  • Note: You may have an updated minor version.

Congratulation ….!!! Java is installed successfully on your machine. You can start using it.

Recommended For You

About the Author: Nilang

Nilang Patel is a technology evangelist who loves to spread knowledge and helping people in all possible ways. He is an author of two technical books - Java 9 Dependency and Spring 5.0 Projects.

2 Comments to “Install Java on Windows”

    1. Hi Shilpa,

      Welcome to Techblog. Yes,I am planning to write blog on advance java and other technologies like Sprint, hibernet etc.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.