Java Installation and Environment Setup (Windows)
To set up Java on your Windows machine, follow these steps:
Step 1: Download Java Development Kit (JDK)
- Visit the official Oracle JDK download page.
- Choose the correct version (latest LTS release is recommended).
- Download the appropriate version for your operating system (Windows x64 Installer).
Step 2: Install JDK
- Once the download is complete, run the installer.
- Follow the installation instructions and choose the default path unless you want to specify a different installation directory.
- After installation, the JDK and JRE will be installed on your system.
Step 3: Set Up Environment Variables
To make Java accessible from the command line, you need to set environment variables.
Open Environment Variables:
- Press Windows + S and search for Environment Variables.
- Click on Edit the system environment variables.
- In the new window, click on Environment Variables.
Set JAVA_HOME:
- In the System Variables section, click New.
- Set the Variable Name to JAVA_HOME.
- Set the Variable Value to the path where JDK is installed. For example: C:\Program Files\Java\jdk-17.
Edit PATH Variable:
- In the System Variables section, find the Path variable and select it.
- Click Edit, and in the new window, click New.
- Add the path to the bin directory of the JDK installation. For example: C:\Program Files\Java\jdk-17\bin.
- Click OK to save the changes.