How to Install Java 1.8

JRE vs. JDK

When downloading Java, many people have trouble knowing if they should download the JRE (Java Runtime Environment) or the JDK (Java Development Kit). The JRE is used when you simply want to run a program that uses Java. The JDK is used for any java development purposes. In this series, we will download the JDK (It also includes the JRE).

Installing the JDK

Navigate to the JDK Download Page to start downloading Java! You will be presented with a screen that looks like this:

Fig. 1 – You must accept the License Agreement before you are allowed to download any of these files.

Select the installer or compressed file for your Operating System. In my case, this is the Windows x64 executable because I am running Windows 10 with a 64-bit architecture. If you do not know what Operating System you are running, check out this article by lumen for Windows, here for Macintosh. If you are running Linux, check out this guide to installing JDK on Linux.

Run the installer once it has downloaded and follow the installation wizard through.

Fig. 2 – You may leave the destination folder at its default value
Fig. 3 – Installation in progress

Verify the installation

After completing the installation, we need to verify that our system recognizes java as a command. Open the terminal/command prompt:

Fig. 4 – Type ‘cmd’ into the Windows Explorer Search Bar

Once the command prompt is open, simply type ‘java -version’ like the following:

Fig. 5 – Checking the Java version

The line ‘java version “1.8.0_221″‘ will look different depending on what the current version of Java is.

Troubleshooting

If the system does not recognize java as a command, it means that java has not been added as an environment variable. Here is how to do that on Windows 10:

1. Search in Windows for ‘environment variables’.
2. Open the system properties panel and click the ‘Environment Variables…’ button.
3. Under System variables, select CLASSPATH and click ‘Edit…’
4. Make sure you have an entry that points to your java executable file. (in my case, it is C:\Program Files (x86)\Common Files\Oracle\Java\javapath)

Finished

And there you have it, Java is installed and ready to be used! The next step is installing an IDE to use to make development easy! Please let me know in the comments if you run into any problems or think I can improve this guide.

Next Step >>

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.