Java Environment
Lesson 3
NEIL A. MUTIA, MIT
For Laptop Installation and
Configuration
If you are new to a specific computer, and you want to run a java program,
the first thing to do is to check if that computer has a Java Development Kit
installed. To perform the testing, you have to open the CMD and type “javac
-version”. If the CMD displays this message, it means that java is not yet
installed on the computer.
For Laptop Installation and
Configuration
To download the Java Development Kit, you must go to Google
and search for “java JDK download”.
Figure 2.1 “java jdk download” search result
For Laptop Installation and
Configuration
Scroll down and look for the Windows tab
For Laptop Installation and
Configuration
then click the highlighted link to download the Java Development
Kit
For Laptop Installation and
Configuration
Installing the Java Development Kit
In this stage, you have to look for the downloaded JDK installer on your
computer.
Double click the installer, wait for a confirmation screen to appear, then
click yes. An installation wizard will appear and all you have to do is to
click the next button. Please follow the figures below to continue the
process.
For Laptop Installation and
Configuration
Figure 2.4 Screenshot of Process 1
For Laptop Installation and
Configuration
Figure 2.5 Screenshot of Process 2
For Laptop Installation and
Configuration
Figure 2.6 Screenshot of Process 3
For Laptop Installation and
Configuration
For Laptop Installation and
Configuration
Click the Close button, then find the installation directory of the Java Development Kit
on your computer. Most of the JDK installation directory is in Local Disk C > Program
Files > Java. Since the JDK version I installed is JDK 14.0.2, so you have to open that
folder and also open the bin folder inside it. The directory in your Windows explorer
must be like this (see Figure 2.8).
Figure 2.8 Screenshot of the directory of the jdk-14.0.2
For Laptop Installation and
Configuration
Copy the directory “C:\Program Files\Java\jdk-14.0.2\bin” and follow the processes
shown in the figures below. Right-click the “This PC” on your computer and select
Properties
Figure 2.9 Screenshot of the This PC on my computer
For Laptop Installation and
Configuration
Afterclicking the Properties, this screen will appear (see Figure 2.10). Click the
Advanced system settings
Figure 2.10 Screenshot of the This PC properties
For Laptop Installation and
Configuration
Figure 2.11 Screenshot of the System Properties
For Laptop Installation and
Configuration
Figure 2.12 Screenshot of the Environment Variables
For Laptop Installation and
Configuration
Figure 2.13 Screenshot of the Environment Variables 2
For Laptop Installation and
Configuration
Select the “Path” under System variables window and click the button
“Edit”
Figure 2.14 Screenshot of the edit Environment Variables
For Laptop Installation and
Configuration
On the Edit environment variables screen, click New and paste the copied JDK directory, then
click OK for every opened window.
Figure 2.15 Screenshot of the edit Environment Variables with the JDK Directory
For Laptop Installation and
Configuration
At this point, the Java Development Kit is successfully installed on your computer. To verify it,
do the process in 2.1 Testing a Computer. If java version will appear like this (see Figure
2.16), java is already installed on your computer.
Figure 2.16 Screenshot of CMD that indicates JDK is already installed on the computer