Chapter 1 — Introduction to Java & JVM
📚 Chapter Overview
This chapter introduces the world of Java, exploring its "Write Once, Run Anywhere" philosophy, the essential architecture of the JVM, and setting up your first professional development environment.
Learning Objectives:
- Understand the core features and history of Java.
- Differentiate between JDK, JRE, and JVM.
- Write, compile, and run your first Java program.
1.1 What is Java & Its Features
Part 1 — Definition
Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. Developed by James Gosling in 1995, it is famous for its platform independence, robustness, and security. Java code is compiled into "Bytecode," which can run on any device equipped with a Java Virtual Machine (JVM).
Part 2 — Syntax
public class Main {
public static void main(String[] args) {
// Your code here
}
}
Part 3 — Example
Problem: Print a welcome message to the console.
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Intelle Learn Java Mastery!");
}
}
Output: Welcome to Intelle Learn Java Mastery!
Part 4 — Video
Video: Coming Soon
Video Link: [Add YouTube Video Link Here]
1.2 The JVM Architecture (JDK vs JRE vs JVM)
Part 1 — Definition
Understanding the Java ecosystem is crucial. JVM is the engine that runs bytecode. JRE is the environment that includes the JVM and libraries needed to run apps. JDK is the full developer kit that includes the JRE plus tools like the compiler (javac).
Part 2 — Commands
javac MyFile.java // Compiles source to bytecode (.class)
java MyFile // Executes the bytecode via JVM
Part 3 — Example
To verify your installation, you can run the following command in your terminal:
java -version
Expected Result: It should display the installed Java version (e.g., java 17.0.x).
Part 4 — Video
Video: Coming Soon
Video Link: [Add YouTube Video Link Here]
🏆 Chapter Challenge
Challenge Objective
Verify your development environment by creating a class that displays your professional developer profile.
Requirements
- Create a file named
DeveloperProfile.java. - The output must include your Name and "Java Environment Verified."
Step-by-Step Process
- Install JDK 17+ on your machine.
- Open a text editor and write the class structure.
- Compile the file using
javacin the terminal. - Run the resulting
.classfile usingjava.
Expected Deliverables
DeveloperProfile.javasource code.- A screenshot of the successful terminal output.