Site icon Kahawatungu

How to Install JDK in Windows 11

How to Install JDK in Windows 11 How to Install Apps in a Laptop

Learning how to install JDK in Windows 11 allows you to develop, compile, and run Java applications on your computer. The Java Development Kit (JDK) is a software package that provides essential tools for Java programming, including the Java compiler, Java Runtime Environment components, and other development utilities. Whether you are a student, beginner, or software developer, installing JDK is an important step towards creating Java programs.

  1. Check Your Windows 11 System Requirements

Before installing JDK, make sure your laptop meets the basic requirements.

You need:

You should also check whether your computer uses a 64-bit operating system by opening Settings, selecting System, and clicking About.

  1. Visit the Official Java Website

The first step is to download JDK from a trusted source.

Open your browser and visit the official Oracle Java website or the Eclipse Temurin website.

Look for the Java Development Kit download section and select a Windows version compatible with your laptop.

Choose a supported JDK release, such as JDK 21 or another version required by your programming project.

  1. Download the JDK Installer

After selecting your preferred JDK version, choose the Windows installer.

For most Windows 11 laptops, select the x64 installer.

If you are downloading from Oracle, you can choose the Windows executable installer with the .exe extension.

Click Download and wait for the installation file to finish downloading.

  1. Run the JDK Installer

Open your Downloads folder and locate the downloaded JDK installation file.

Double-click the installer to begin the setup process.

If Windows asks for permission to make changes to your device, click Yes.

The installation wizard will appear and guide you through the process.

Click Next to continue with the installation.

  1. Choose the Installation Location

The installer will ask you where you want to install JDK.

You can use the default installation folder or select another location on your laptop.

For example, the default Oracle installation folder may look like:

C:\Program Files\Java\jdk-21

Click Next or Install, depending on the installer, and wait for the installation to complete.

  1. Configure the JAVA_HOME Environment Variable

Configuring JAVA_HOME helps development tools locate your JDK installation.

Follow these instructions:

For example:

C:\Program Files\Java\jdk-21

Make sure the folder matches the JDK version and installation location on your laptop.

  1. Add Java to the Windows PATH

Adding Java to PATH allows you to run Java commands from Command Prompt.

In the Environment Variables window:

Close and reopen Command Prompt so Windows can recognise the updated environment variables.

  1. Verify the JDK Installation

After completing the installation, confirm that JDK is working correctly.

Press Windows + R, type cmd, and press Enter.

In Command Prompt, enter:

java -version

Press Enter to display the installed Java version.

Next, enter:

javac -version

This command checks whether the Java compiler is available.

If both commands display version information, your JDK installation and PATH configuration are working correctly.

  1. Write and Run Your First Java Program

You can now test your JDK installation by creating a simple Java program.

Open Notepad and enter:

public class HelloWorld {

public static void main(String[] args) {

System.out.println(“Hello World!”);

}

}

Save the file as HelloWorld.java.

Open Command Prompt, navigate to the folder where you saved the file, and run:

javac HelloWorld.java

Then enter:

java HelloWorld

Your computer should display Hello World! This confirms that Java can compile and run your program.

Also Read: How to Install Adobe Photoshop on a Laptop

Stay connected via Google News
Follow us for the latest news updates and guides.
Exit mobile version