This post introduces how to Download & Install JDK 8 on Windows so you can develop and run Java code. Java applications compile to bytecode (class file) that can then run on a Java Virtual Machine (JVM). Java is currently owned by the Oracle Corporation which acquired Sun Microsystems in 2010. Let’s start now.
Download & Install JDK 8 on Windows
Java Development Kit (JDK) package that comes with a Java compiler that we need to compile Java code. The JDK package also comes with a Java runtime environment (JRE) that is needed to run compiled Java code.
Select the correct operating system under Java SE Development Kit 8u241 for your Windows
On the popup windows, you accept the License Agreement and click Download button then the download should start. If you have not login you are required to login with your Oracle account before starting download. Once the download is complete, you download Java SE 8 successfully.
Now, to install JDK 8 on Windows that you locate the jdk-8u241-windows-x64.exe file and double-click to run the installer.
Click Next button, in this example, the install location was changed to
C:\Program Files\Java\jdk1.8.0_241 .
Next, actually you have JRE already on the folder
C:\Program Files\Java\jdk1.8.0_241 . So we don’t install public JRE. Select the Public JRE dropdown then click on This feature will not be available. to remove that installation as shown below.
Click Next button and then Close button to finish installing Java.
We need to set up a ‘JAVA_HOME’ environment variable and the ‘PATH’ environment variable. Open Environment Variables window to add environment variables for your account and the following panel should appear.
Click on the New button and add ‘JAVA_HOME’ environment variable, this variable will point your Java installation folder above, like below
Normally, the “PATH” variable exists on your Windows, so click the Edit button. Then, add the JDK bin folder %JAVA_HOME%bin to the beginning of the Path value.
Then click OK button to close the environment variables panel.
Now, we can verify whether the above environment variables configuration works or not by running the below command in command prompt
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b11, mixed mode)
Congratulation, you have JDK 8 installed on your windows. You may want to know more about Java knowledge, please check out this tutorial Top 12 Java Basic Interview Questions and Answers