How to Download & Install Java JDK 8 in Windows

⚡ Smart Summary

Install Java JDK 8 in Windows by downloading the Development Kit from Oracle, running the installer, and configuring environment variables. This resource explains each download and installation step and how to set the PATH and CLASSPATH so that javac and java run from any command prompt.

  • JDK Purpose: The Java Development Kit lets you compile and run Java programs, and multiple versions can coexist on one PC.
  • ⬇️ Download: Get JDK 8 from Oracle, accept the license agreement, and choose the 32-bit or 64-bit version.
  • 🛠️ Install: Run the downloaded installer and follow the on-screen steps, keeping the default installation path.
  • 🧭 Set PATH: Add the JDK bin folder to the PATH variable so commands like javac and java work anywhere.
  • 📚 Set CLASSPATH: Point CLASSPATH to the library files, then verify the setup with javac in Command Prompt.

How to Download and Install Java JDK 8 in Windows

This Java Development Kit (JDK) allows you to code and run Java programs. It is possible to install multiple JDK versions on the same PC, but it is recommended to install Java on Windows 10 with the latest version.

How to Install Java for Windows 10 (64-bit)

Following are the steps to install Java in Windows 10, for the JDK 8 free download for 32-bit or JDK 8 download for Windows 64-bit, and installation.

Step 1) Go to this link. Click on JDK Download for the Java JDK 8 download.

How to install Java for Windows

Step 2) Next:

  1. Accept the License Agreement.
  2. Download Java 8 JDK for your version, 32-bit or 64-bit.

How to install Java for Windows

Step 3) When you click on the installation link, the popup will open. Click on “I reviewed and accept the Oracle Technology Network License Agreement for Oracle Java SE Development Kit” and you will be redirected to the login page. If you do not have an Oracle account, you can easily sign up by adding your basic details.

How to install Java for Windows

NOTE: You will be required to create an Oracle account to start the Java 8 download of the file.

Step 4) Once the Java JDK 8 download is complete, run the exe to install the JDK on Windows. Click Next.

How to install Java for Windows

Step 5) Select the PATH to install Java in Windows. You can leave it as default. Click Next.

How to install Java for Windows

NOTE: Follow the on-screen instructions in the succeeding steps to install Java 8 on Windows 10.

Step 6) Once you install Java in Windows, click Close.

How to install Java for Windows

How to set Environment Variables in Java: Path and Classpath

The PATH variable gives the location of executables like javac, java, etc. It is possible to run a program without specifying the PATH, but you will need to give the full path of the executable, like C:\Program Files\Java\jdk1.8.0_271\bin\javac A.java instead of a simple javac A.java.

The CLASSPATH variable gives the location of the library files.

Let us look into the steps to set the PATH and CLASSPATH.

Step 1) Right-click on My Computer and select Properties.

Set Environment Variables in Java

Step 2) Click on Advanced system settings.

Set Environment Variables in Java

Step 3) Click on Environment Variables to set the Java runtime environment.

Set Environment Variables in Java

Step 4) Click on the New button of User variables.

Set Environment Variables in Java

Step 5) Type PATH in the Variable name.

Set Environment Variables in Java

Step 6) Copy the path of the bin folder, which is installed in the JDK folder.

Set Environment Variables in Java

Step 7) Paste the path of the bin folder in the Variable value. Click on the OK button.

Set Environment Variables in Java

Note: In case you already have a PATH variable created on your PC, edit the PATH variable to:

PATH = <JDK installation directory>\bin;%PATH%;

Here, %PATH% appends the existing path variable to our new value.

Step 8) You can follow a similar process to set the CLASSPATH.

Set Environment Variables in Java

Note: In case your Java installation does not work after installation, change the CLASSPATH to:

CLASSPATH = <JDK installation directory>\lib\tools.jar;

Step 9) Click on the OK button.

Set Environment Variables in Java

Step 10) Go to the command prompt and type the javac command.

If you see a screen like the one below, Java is installed.

Set Environment Variables in Java

Having trouble installing Java? Check our Online Java Compiler.

FAQs

Yes. AI assistants can guide JDK installation, generate correct PATH and CLASSPATH values, and troubleshoot errors. However, you still apply the configuration changes on your own system and verify them yourself.

It depends. Several big-data and AI frameworks, such as Hadoop and Spark, run on the JVM and require Java. Many Python-based machine learning tools do not need a JDK installed.

The JDK is the full development kit for writing and compiling Java. The JRE runs Java programs. The JVM is the engine inside the JRE that executes compiled Java bytecode.

Open Command Prompt and type “java -version” or “javac -version”. If a version number appears, Java is installed and correctly added to your system PATH variable.

Summarize this post with: