Install Java on Windows: Step-by-Step Guide

Learn how to install the Java Development Kit (JDK) on Windows, configure PATH and JAVA_HOME, verify the setup, and troubleshoot common issues with a home-friendly, step-by-step approach.

Install Manual
Install Manual Team
·5 min read
Quick AnswerSteps

This guide shows you how to install Java on Windows, verify the installation, and configure PATH and JAVA_HOME. You’ll learn how to choose the right JDK source, run the installer with admin rights, and troubleshoot common issues. By the end, you’ll be ready to compile and run Java programs on Windows.

Before you start: check system and prerequisites

According to Install Manual, installing Java on Windows starts with a clear plan. If you want to install java windows, you need to verify that your PC runs Windows 10/11 or newer and has at least 2 GB of free disk space, plus administrator rights. Determine whether you will download the 64-bit or 32-bit JDK based on your system type by checking Settings > System > About. Preparing the right version minimizes compatibility issues later. Having a browser ready to download the installer helps keep the process smooth. This preparatory step reduces the chance of mid-install surprises and sets you up for a clean, repeatable installation workflow. You will learn why choosing the correct edition (JDK vs. JRE components) matters for development, testing, and future updates. Throughout this guide, you’ll see practical steps that you can follow even if you are new to Java development. The goal is to give you a reliable baseline so you can run Java programs on Windows with confidence.

Downloading the official JDK sources

To ensure security and reliability, obtain the Java Development Kit (JDK) from official sources. You can download from Oracle's Java site or from OpenJDK builds provided by reputable vendors. Choose an LTS version if you need long-term stability, or a newer release if you want the latest features. Double-check that the file you download matches your Windows architecture (x64 or x86) and that the installer is an executable suitable for Windows (.exe or .msi). Store the installer in a known location so you can access it quickly during setup. Avoid third-party mirrors to minimize security risks and ensure you receive authentic updates from the source.

Installing the JDK on Windows

Run the downloaded installer with administrative privileges by right-clicking and selecting Run as administrator. Follow the prompts, accept the license agreement, and choose an installation path. The default path is usually fine, but if you have a preferred location, select it and note it for the JAVA_HOME step later. The installer may include both the JDK and optional components; confirm what you want installed. Finish the installation and close the installer when complete to proceed to environment configuration.

Configuring JAVA_HOME and updating PATH

After installation, set up environment variables so Java tools work from any Command Prompt or terminal. Create a JAVA_HOME variable that points to the JDK installation directory, such as C:\Program Files\Java\jdk-XX. Then add %JAVA_HOME%\bin to the system PATH so commands like java and javac run from any folder. On Windows 10/11, access System Properties > Advanced > Environment Variables, create or edit JAVA_HOME, and append to Path. Open a new Command Prompt to apply the changes; existing terminals won’t see the new values until relaunched. This step makes Java development convenient and repeatable across projects.

Verifying the installation and first run

Open a new Command Prompt and run java -version and javac -version to verify the installation. You should see the Java version reported without errors. Next, compile and run a simple HelloWorld.java program to confirm the toolchain works. If you encounter issues, re-check JAVA_HOME and PATH settings and ensure you downloaded a compatible JDK for your system. Keeping a small test file helps you quickly confirm that the development environment is functional.

Troubleshooting and maintenance

If you run into problems, common culprits include missing PATH entries, incorrect JAVA_HOME paths, or permission prompts blocked by security software. Ensure you installed the JDK (not just a JRE) and that all paths point to the correct folder. If Windows Defender or antivirus software blocks the installer, verify the source and signature, then re-run as administrator. Plan for periodic updates and test after updates to ensure the tools remain usable across projects.

Tools & Materials

  • Windows PC (Windows 10, 11, or newer)(Ensure you have administrative rights to install software)
  • Internet connection(Needed to download the JDK and receive updates)
  • Java Development Kit (JDK) installer from official sources(Choose Oracle or OpenJDK; ensure it matches your Windows architecture)
  • Web browser(To access the official download pages)
  • Administrative access to modify environment variables(Needed for JAVA_HOME and PATH configuration)
  • Optional: IDE or text editor(Helpful for writing and running Java code after setup)

Steps

Estimated time: 20-30 minutes

  1. 1

    Check system readiness

    Review Windows version, available disk space, and user privileges. Confirm you are on Windows 10/11 or newer and have admin rights to install software. This reduces surprises later and sets a solid foundation for the Java toolchain.

    Tip: Use Settings > System > About to confirm OS type and architecture (64-bit vs 32-bit).
  2. 2

    Download the JDK from official sources

    Navigate to Oracle’s Java site or a trusted OpenJDK build page and download the appropriate Windows installer (x64 or x86). Save it to a known folder so you can access it quickly during installation.

    Tip: Verify the download source and avoid third-party mirrors to maintain security.
  3. 3

    Run the installer as administrator

    Right-click the downloaded file and select Run as administrator. Follow the prompts, accept the license agreement, and choose the installation path. The installer may include the JRE; confirm which components you want.

    Tip: If prompted for permission, allow the installer to make changes to your device.
  4. 4

    Set JAVA_HOME after installation

    Open System Properties > Advanced > Environment Variables and create a JAVA_HOME variable pointing to the JDK directory. This step helps tools locate Java components reliably.

    Tip: Copy the exact folder path from the installation directory to avoid typos.
  5. 5

    Update the PATH to include Java binaries

    Append %JAVA_HOME%\bin to the system PATH so commands like java and javac work from any directory in a Command Prompt. This makes development workflows smooth and repeatable.

    Tip: Always open a new Command Prompt after saving changes to apply the new PATH.
  6. 6

    Verify the installation

    Run java -version and javac -version in a fresh terminal to confirm Java is installed correctly. If you see version output, you’ve set up the environment properly.

    Tip: Create a small HelloWorld.java file and try compiling to validate the toolchain.
  7. 7

    Clean up and rationalize your setup

    Delete the installer if you no longer need it and organize your projects folder. Keeping a clean workspace helps prevent confusion when updating or switching JDK versions.

    Tip: Document the JDK version and installation path for future maintenance.
Pro Tip: Download the correct JDK edition (x64 for most modern Windows PCs) to avoid runtime issues.
Warning: Do not mix environment variables across user accounts; use consistent paths for JAVA_HOME and PATH.
Note: If you have multiple JDK versions, consider using a version manager or carefully set JAVA_HOME per project.

Got Questions?

What is the difference between JDK and JRE, and which do I need?

The JDK includes development tools such as javac for compiling Java programs, while the JRE runs Java applications. If you plan to develop or compile code, install the JDK. For simply running Java programs, the JRE is sufficient, but most developers install the JDK for full tooling.

The JDK is for developing and compiling Java code; the JRE runs Java apps. If you’re learning or building, choose the JDK.

Can I install multiple JDK versions on Windows and switch between them?

Yes, you can install multiple JDK versions. Use JAVA_HOME to point to the version you’re using for a project and adjust PATH accordingly. Tools like IDEs often let you configure a specific JDK per project.

You can have several JDKs installed. Switch by updating JAVA_HOME and PATH per project.

Why isn’t Java recognized in Command Prompt after installation?

This usually means JAVA_HOME or PATH wasn’t updated correctly or Windows hasn’t acknowledged the changes yet. Open a new Command Prompt after editing environment variables and verify the paths.

If your system can’t find Java, re-check JAVA_HOME and PATH and reopen your terminal.

Do I need to reboot my computer after installing Java?

A full reboot is not always required, but restarting the shell or logging out and back in ensures environment variable changes take effect. A reboot guarantees all processes pick up the new settings.

Usually you don’t have to reboot, but restarting your command line or user session helps.

How can I uninstall an old Java version safely?

Go to Settings > Apps, locate the older Java version, and choose Uninstall. Then clean up JAVA_HOME and PATH if they point to the removed directory. Reinstall the desired version if needed.

Uninstall the old version from Apps and tidy up JAVA_HOME and PATH paths.

Is it better to download Java from Oracle or OpenJDK?

Oracle and OpenJDK provide solid options. Oracle often targets enterprise environments with commercial support, while OpenJDK builds are community-driven. Choose based on your needs and ensure you stay on a supported version.

Both are reliable; pick Oracle for enterprise support or OpenJDK for community builds.

What if I’m on a restricted PC without admin rights?

Installing Java without admin rights is challenging on Windows. You may need to request temporary access or use a portable JDK if your environment allows it. For most setups, admin access is required.

Without admin rights, install options are limited; ask for access or use a portable alternative if permitted.

Watch Video

Main Points

  • Verify Windows compatibility and admin access before starting.
  • Always download from official sources for security.
  • Set JAVA_HOME and PATH correctly to enable development tools.
  • Verify installation with java -version and a small test program.
  • Keep Java updated and document the installed version.
Process diagram showing 3 steps to install Java on Windows
3-step Java installation on Windows

Related Articles