How to Install Java (JDK)
This is the first step to start programming in Java.
There are different steps to install Java on different operating systems like Windows, macOS, and Linux. we have different java versions available in the market, but we will start with Java 8, which is the most widely used version of Java. You can also install the latest version of Java if you want to use the latest features.
Usually you will see two main options :
- Oracle JDK : Oracle JDK is the official version of Java
- OpenJDK : OpenJDK is an open-source version of Java.
Both versions are free to use, but Oracle JDK has some additional features and supports. and differ in licensing, support, and distribution.
Install Java on Windows:
- Go to the Oracle JDK download page
here you can see multiple tabs for for different Operating systems, click on the Windows tab to download the installer for Windows.
Now select x64 installer for window 64-bit or select x86 installer for window 32-bit, and click on the download button to start downloading the installer.
-
Now go to the download location and double click on the installer to start the installation process and close it.
-
Now we need to set the environment variable for Java. follow below steps :
- press Window Key , Type "Environment Variables" and click on Edit the system environment variables. you will see below image :

- In the System Properties window, click on the "Environment Variables" button.
- click on the Environment Variables button window, you will see below image:

under System variables, click on the "New" button.

- In the New System Variable window, enter JAVA_HOME as the variable name and for the path go to your Java installation folder (e.g., C:\Program Files\Java\jdk1.8.0_291).

- Click OK to save the variable.
- Now find the "Path" variable in the System variables section and click on "Edit".

- In the Edit Environment Variable window, click on "New" and add Java installation path up to bin folder (e.g., C:\Program Files\Java\jdk1.8.0_291\bin) to the list of paths.

- Click OK to save the changes.
-
Now to verify the Java installation, open Command Prompt and type the following command:
java -versionyou will see the installed Java version in the output :
- Congratulations! You have successfully installed Java on your Windows machine π.
See you in next page....π