
A Step-by-Step Guide to Install and Set Up Java
Jan 31, 2025 2 Min Read 772 Views
(Last Updated)
Java is one of the most widely used programming languages, and to start developing Java applications, you need to install the Java Development Kit (JDK). Whether you’re a beginner or an experienced developer, setting up JDK correctly is crucial for seamless development. In this guide, we’ll walk you through the step-by-step process of downloading, installing, and configuring JDK on your system.
Table of contents
- Step 1:
- Step 2:
- Step 3:
- Step 4:
- Step 5:
- Step 6:
- Step 7:
- Setting up Environment in Java
- Step 1:
- Step 2:
- Step 3:
- Step 4:
- Step 5:
- Conclusion
- Frequently Asked Question
- What is JDK, and why do I need it?
- Do I need an Oracle account to download JDK?
Step 1:
Open https://www.oracle.com/java/technologies/javase-downloads.html in the browser and it will navigate to the official Oracle Java downloads page.
Step 2:
- Select the version of the Java which you want to download.
- Select the operating system.
- Step 3: Scroll down to the page and click on the URL option suitable for your computer Operating system. But for a 64-bit machine, choose the software name ending with x64.
- x64MIS Installer for Windows
- x64 DMG Installer for macOS

Step 3:
After the downloading procedure is complete, we need to run the installer

Step 4:
Once the Java installation wizard opens, click on the Next button as shown below:

Step 5:
Again click on the Next button if we wish to install the Java development kit in the default directory(encircled with green color), or we can change this directory by clicking on the Change button.

Step 6:
The installation will begin as shown below:

Step 7:
Finally, we can click on the Close button after the confirmation window appears which saying that the Java is installed.

Also Explore: 10 Java Project Ideas of All Levels [With Source Code]
Setting up Environment in Java
- After downloading, Once you install Java on your device, you must set up the environment variable.
Step 1:
Locate the JDK Installation Folder:
After installing the JDK, finding out where it’s installed is important. By default, java is installed in the “C:\Program Files\Java\jdk\bin” folder OR “C:\Program Files(x86)\Java\jdk\bin”. In case, you have installed Java at any other location, then add that path.
C-drive 🡪 Program Files🡪java 🡪 jdk 🡪 bin (copy the path)
Step 2:
Go to the search bar and search for Environment variable -> click on Edit system Environment variable.
Under the Advanced System Setting option click on Environment Variables as highlighted below.

Step 3:
Now, you have to alter the “Path” variable under System variables so that it also contains the path to the Java environment. Select the “Path” variable and click on the Edit button as highlighted below.

Step 4:
You will see a list of different paths, click on the New button, and then add the path where java is installed. By default, java is installed in “C:\Program Files\Java\jdk\bin” folder OR “C:\Program Files(x86)\Java\jdk\bin”. In case, you have installed java at any other location, then add that path.

Step 5:
Click on OK, Save the settings, and you are done !! Now to check whether the installation is done correctly, open the command prompt and type java –version. You will see that Java is running on your machine.
Unlock your potential as a Java Full-Stack Developer with our comprehensive Java Full-Stack development course! Dive deep into the world of Java, mastering front-end and back-end development to build powerful, dynamic web applications. Gain hands-on experience with essential tools and frameworks like Spring Boot, Hibernate, Angular, and React, all while learning best practices for performance optimization and scalable coding. Start your journey today and become the all-in-one developer every company is searching for!
Conclusion
Setting up JDK is the first step towards Java development, and by following this guide, you can ensure a smooth installation process. Once installed, configuring the environment variables allows you to run Java programs efficiently. Now that your JDK is ready, you can start coding and building powerful Java applications.
Frequently Asked Question
JDK (Java Development Kit) is a software development kit used for developing Java applications. It includes the Java Runtime Environment (JRE), compiler, libraries, and other tools needed to write and execute Java programs.
For newer Oracle JDK versions, you might need an Oracle account to download certain releases. Alternatively, you can use OpenJDK, which is free and does not require an account.
Did you enjoy this article?