Java - Environment Setup
To write and run Java programs, the first thing you need is the Java Development Kit (JDK).
We will guide you step by step through the installation and setup.
It is simple, and you will be ready to code in no time!
Step 0: Download the Latest JDK (Java Development Kit)
To begin, kindly visit the official Oracle website and download the latest JDK.
Just choose the version that matches your system - for most users, the Windows x64 Installer works best.
Here is the link to get you started: https://www.oracle.com/java/technologies/downloads/
Step 1: Run the Installer
Once the .exe file is downloaded, double-click to run the installer.

- Follow the on-screen instructions.
- By default, JDK will be installed in:
C:\Program Files\Java\jdk-<version>
(You can change the location if needed.)Step 2: Set Up Environment Variables
After installing the JDK, it is important to set up the system environment so Java works from the command line.
Follow these steps:
1. Right-click on This PC or My Computer, and select Properties.

2. Click on Advanced system settings > Environment Variables.


3. Inside the installed JDK folder, navigate to the bin folder and copy the path:
Example:
C:\Program Files\Java\jdk-<version>\bin

4. Now Click on Environment Variables then Go to the System Variables, find the variable named Path and click Edit.
Paste the copied path and click OK.

If no Path variable exists, click New and:
- Variable name: Path
- Variable value: (Paste your bin folder path)

Step 3: Verify Installation
Open Command Prompt and type:
javac -version
If everything is correct, you will see the installed version number of the Java Compiler (javac).

Two Minute Drill
- Install JDK: Download and install the latest JDK.
- Set JAVA_HOME: Enter JAVA_HOME to update the configuration path.
- Select IDE: Install and configure the IDE (e.g., IntelliJ, Eclipse).
- Test Setup: A "Hello, World!" Program to ensure that the system works.
Congratulations! You have successfully installed and set up Java on your system. Now you are ready to write your first Java program.