How to Install JDK for
Java Development:
Java Development
Kit (JDK) is essential for writing, compiling, and running Java programs.
Follow these steps to install JDK on your system:
Step 1:
Download the JDK
1. Visit the official Oracle website: https://www.oracle.com/java/technologies/javase-downloads.html.
2. Select the version of JDK suitable for your
operating system (Windows, macOS, or Linux).
3. Click the download link and accept the
license agreement.
Step 2:
Install the JDK
1. Locate the downloaded installer file in your
system’s downloads folder.
2. Double-click the installer to begin the
installation.
3. Follow the on-screen instructions:
o
Select
the installation path (default path is usually fine).
o
Complete
the setup by clicking “Next” or “Install”.
Step 3: Set Up
Environment Variables (Windows Only)
1. Open System Properties by searching
for "Environment Variables" in the Start Menu.
2. In the System Properties window, click
on the Environment Variables button.
3. Under System Variables, find and
select the Path variable, then click Edit.
4. Add the path to the JDK’s bin directory
(e.g., C:\Program Files\Java\jdk-XX.X.X\bin) and click OK.
5. To verify the setup, open a command prompt
and type: java -version You should see the installed JDK version.
Step 4: Verify
Installation
1. Open a terminal or command prompt.
2. Type the following command to check the Java
Compiler: javac -version This confirms that the JDK is successfully installed.
·
Open
Java folder by default is: C:\Program Files\Java\jdk-23
· Copy the bin folder path
·
Open
Edit the system Environment variable.
·
Then
click Environment variables button.
·
Select
Path and hit edit button
·
Click
New Button and paste the copied path. (C:\Program Files\Java\jdk-23\bin) and
press OK button.
·
Come
previously tab and click New Button.
·
Now set
this name and path as per image.
·
Now
press all ok & apply button and open CMD to check Java properly installed
and path set.
·
Open CMD
and type java –version and hit enter, enjoy java.