DEV Community

Cover image for JAVA Basics #1 - Installation
Chathumi Kumarapeli
Chathumi Kumarapeli

Posted on • Updated on

JAVA Basics #1 - Installation

Introduction to Java

This is the first article of the series of articles Basics of Java. This article set is ideal for beginners because in this articles series we are going to learn Java from the scratch.

Java is an object-oriented and class-based programming language that was released by Sun Microsystems in the year 1995.

alt text

Java Installation for Windows

To code and execute java programs you have to have Java Development Kit (JDK) installed in your machine.
alt text

First you have to visit this site, and click 'JDK download' of the latest version as show in the given image.
alt text6

It is not prohibited to have several JDK versions in the same machine, but it is always recommended to have only the latest version.

Next you will be directed to a page looking like this;
alt text7

Scroll down till you reach the grid 'Java SE Development Kit'. There you have to choose the file matching to your operating system. Then accept the license agreement and hit download.
alt text9

Once the download is completed, open the downloaded file and let it to be installed. All you have to do is following the instructions given in the menu boxes.

Setting Environment Variables

Once the installation is completed you have to set environment variables. First go to the folder where you have installed the JDK. Then proceed to the bin folder. Copy the path up to there.
alt text11

Then go to the Settings of your machine and select System.
alt text12

Then select the following option.
alt text13

After that you have to select 'Environmental Variables...'
alt text14

Next, select the variable 'path' and click 'Edit'.
alt text15

Click 'New' and paste the path (to bin folder) that you have copied before, and hit OK.
alt text16

Setting System Variables

Now you have to set system variables. Here you have to copy the path up to bin folder (excluding it).
Click New in system variables section and give a name and the path and hit OK.
alt text17

Now we are ready to check whether you have successfully completed the process. First go to the command prompt. Then type java -version. Then if you see the result showing your java version, congratulations you have done perfectly so far.
alt text20

With that we have come to the end of this article. In next article you will learn how to download and install intelij idea in your machine.

Top comments (2)

lbatters profile image

Why do you use Java 8 instead of 11 or 15?

chathurashmini profile image
Chathumi Kumarapeli

Actually I am doing a java specialization in Coursera "Object Oriented Java Programming". So for that course content I need to have Java 8. The codes they have provided us does not work with extensions higher than 8 :/
That was the only reason.