3.1 Lesson Outcomes
After completing this lesson, learners will be able to:
- Download Java Development Kit (JDK).
- Install Java successfully.
- Configure Java development environment settings.
- Create and run a basic Java program.
- Verify Java installation using command-line tools.
3.2 Overview
Before developing Java applications, developers must install and configure the Java development environment correctly. This includes downloading the Java Development Kit (JDK), configuring system settings, and verifying installation.
This lesson introduces learners to Java setup procedures and the practical process of creating and executing a first Java program.
Java installation and setup are important in:
- software development,
- enterprise application development,
- IDE configuration,
- and Java programming environments.
Understanding Java installation and execution is important because all Java development activities depend on a properly configured development environment.
PA0201 — Downloading the Java Development Kit (JDK)
The Java Development Kit (JDK) provides tools required for Java development.
Components of JDK
|
Component |
Purpose |
|---|---|
|
javac |
Java compiler |
|
java |
Java application launcher |
|
JRE |
Runtime environment |
|
JVM |
Executes bytecode |
Practical Activity
Learners must:
- visit the official Java website,
- download the correct JDK version,
- and identify the installation package.
PA0202 — Installing Java
Java must be installed correctly before development can begin.
Installation Steps
|
Step |
Description |
|---|---|
|
Download Installer |
Obtain JDK installer |
|
Run Installer |
Start installation |
|
Configure Installation |
Complete setup |
|
Finish Installation |
Verify installation |
Practical Activity
Learners must:
- install the JDK,
- complete setup successfully,
- and verify installation folders.
PA0203 — Configuring Environment Variables
Environment variables allow the operating system to locate Java commands.
Common Environment Variables
|
Variable |
Purpose |
|---|---|
|
JAVA_HOME |
Java installation path |
|
PATH |
Access Java commands globally |
Example PATH Configuration
Plain text
C:\Program Files\Java\jdk\bin
Practical Activity
Learners must:
- configure JAVA_HOME,
- update PATH variable,
- and test command-line access.
PA0204 — Verifying Java Installation
Java installation must be verified using command-line tools.
Verification Commands
Plain text
java -version
Plain text
javac -version
Practical Activity
Learners must:
- open Command Prompt,
- execute verification commands,
- and confirm successful installation.
PA0205 — Creating First Java Program
A Java program is written inside a .java source file.
Example Java Program
Java
public class Main {
public static void main(String[] args) {
System.out.println(“Hello World”);
}
}
Practical Activity
Learners must:
- create a Java file,
- type the program,
- save the file,
- and compile the program.
PA0206 — Running Java Program
Java programs are executed using the Java Virtual Machine (JVM).
Compilation Command
Plain text
javac Main.java
Execution Command
Plain text
java Main
Expected Output
Plain text
Hello World
Practical Activity
Learners must:
- compile the Java source file,
- run the program,
- and verify successful output.
3.5 Key Notes / Summary
- The JDK provides tools required for Java development.
- Java installation is required before programming.
- Environment variables configure Java command access.
- Java programs are written in
.javafiles. - javac compiles Java source code.
- java executes compiled programs.
- Successful installation is verified using command-line tools.