Skip to lesson
CodeLangs AISoftware Training Institute
Introduction to Java

Chapter 1 · Java Foundations

Introduction to Java

Understand what Java is, why it was created, the JDK/JRE/JVM relationship, bytecode, platform independence, environment setup, and how to write, compile, and run your first Java program.

  • 10,498words
  • 48min read
  • 8quiz items
  • 14practice tools

Java can feel complicated at the beginning because a new learner immediately hears many unfamiliar words: JDK, JRE, JVM, bytecode, compiler, javac, java, classpath, platform independence, and many more.

But these concepts are not separate pieces that you have to memorize.

They form one simple story:

Output
You write Java source code
        ↓
Java compiler compiles it
        ↓
Bytecode is created
        ↓
JVM reads the bytecode
        ↓
Your program runs

Once this flow becomes clear, most of the terminology in this chapter becomes much easier.

So instead of memorizing definitions, we will build the complete picture step by step.

This chapter follows the Java introduction scope you supplied, including Java fundamentals, editions, platform architecture, JDK/JRE/JVM, compilation/execution, environment setup, and the first Java program.


1. Before Java: Why Do We Need a Programming Language?#

Think about your computer for a moment.

You can tell another person:

"Add these two numbers."

But a computer does not understand normal human language in the same way.

At the lowest level, computers execute machine instructions.

Those instructions ultimately become binary patterns such as:

Output
10110000 01100001

Writing large applications directly using machine instructions would be extremely difficult.

Therefore, programming languages were created.

A programming language gives developers a structured way to express instructions such as:

Java
int total = 10 + 20;
System.out.println(total);

The developer writes understandable instructions, and software tools eventually translate those instructions into something the computer can execute.

Different programming languages solve this problem in different ways.

Java is one of them.

But Java became especially important because it introduced a powerful idea:

Compile the source code into an intermediate format that can run on many different operating systems through a Java Virtual Machine.

Keep that idea in mind. We will build it carefully.


2. What Is Java?#

Now that we understand why programming languages exist, we can introduce Java naturally.

Java#

Java is a high-level, class-based, object-oriented, general-purpose programming language and software platform designed to allow applications to run across different environments through the Java Virtual Machine.

That definition contains several terms. Do not memorize it yet.

Let us unpack it.


2.1 High-Level Language#

A high-level programming language allows developers to write instructions using abstractions that are much easier for humans to understand than machine code.

For example:

Java
int age = 25;

if (age >= 18) {
    System.out.println("Eligible");
}

This is much easier to understand than CPU machine instructions.

Java hides many low-level hardware details from the programmer.


2.2 General-Purpose Language#

A general-purpose language is not designed for only one narrow problem.

Java can be used for many types of applications, including:

  • backend systems
  • enterprise applications
  • financial applications
  • web services
  • REST APIs
  • desktop applications
  • distributed systems
  • cloud applications
  • Android-related development historically and through Java-compatible ecosystems
  • data-processing systems
  • testing tools
  • automation software

This versatility is one reason Java became widely adopted.


2.3 Class-Based Language#

Java programs are primarily organized around classes.

You do not need to understand classes completely yet.

For now, remember this:

A class is a structure in which we can define data and behavior.

Example:

Java
class Employee {

    String name;

    void work() {
        System.out.println("Employee is working");
    }
}

Later, object-oriented programming will make this much clearer.


2.4 Object-Oriented Language#

Java strongly supports Object-Oriented Programming, commonly called OOP.

OOP organizes software around objects containing:

Output
Data
+
Behavior

For example, an Employee object may contain:

Output
Data:
name
salary
employeeId

Behavior:
work()
login()
calculateSalary()

Java supports important OOP concepts such as:

  • encapsulation
  • inheritance
  • polymorphism
  • abstraction

We will not expand those concepts here because they deserve their own chapter.

For now, understand only why this matters:

Java allows large applications to be divided into understandable, reusable software components.

3. Why Was Java Created?#

Before discussing Java's history, consider an older software-development problem.

Suppose a company develops software for one type of computer.

Later, it wants to run the same application on another system.

Traditionally, platform differences could require significant changes or recompilation.

Developers wanted software that could be more portable.

The Java project pursued this idea very strongly.

That brings us to Java's origin.


4. History of Java#

Java originated at Sun Microsystems.

A team led by James Gosling worked on a project beginning in the early 1990s.

The language was initially associated with the name:

Output
Oak

It was later renamed:

Output
Java

Java was publicly introduced in the mid-1990s and became strongly associated with the idea:

Write Once, Run Anywhere

Later, Sun Microsystems was acquired by Oracle, and Oracle became the steward of Java.

Java continued evolving through many releases.

The important lesson is not the date memorization.

The important reason Java became significant is its combination of:

  • portability
  • automatic memory management
  • object-oriented programming
  • strong standard libraries
  • runtime safety mechanisms
  • networking capabilities
  • enterprise ecosystem
  • mature tooling

5. What Problem Did Java Solve?#

Imagine that you create an application for:

Output
Windows

But your customer wants the same application to run on:

Output
Linux

And another customer uses:

Output
macOS

A natural question appears:

Do we need a completely different Java program for every operating system?

Java's architecture was designed to reduce this problem.

Instead of compiling Java source code directly into one operating system's native machine instructions, Java normally compiles source code into:

Output
Bytecode

That bytecode is then executed by a:

Output
JVM

This architecture is the foundation of Java's platform independence.

We will examine every part carefully.


6. Features of Java#

Now we have enough context to understand why Java is usually described using a collection of important features.

Do not treat these as marketing words. Each feature describes an actual property of Java's language or runtime ecosystem.


6.1 Simple#

Java was designed to remove or simplify several difficult features commonly associated with lower-level languages.

For example, Java does not expose general-purpose pointer arithmetic in the same way as C or C++.

Memory management is also largely automated.

Instead of manually releasing ordinary Java objects, Java uses garbage collection.

We will discuss garbage collection in a later chapter.

For now:

Java attempts to let developers focus more on application logic and less on manual memory management.

6.2 Object-Oriented#

Java strongly organizes programs around classes and objects.

Example:

Java
class Car {

    String model;

    void start() {
        System.out.println("Car started");
    }
}

An object created from this class could represent an actual car inside the program.


6.3 Platform Independent#

This is one of Java's most important characteristics.

Consider:

Output
Java Source Code
       ↓
Java Compiler
       ↓
Bytecode
       ↓
JVM for Windows
or
JVM for Linux
or
JVM for macOS

The same compiled bytecode can normally run wherever a compatible JVM exists.

That is the foundation behind:

Write Once, Run Anywhere.

6.4 Portable#

Platform independence and well-defined language/runtime behavior help Java applications move across supported environments.

Java defines consistent primitive type sizes and standardized runtime behavior in many areas.

This improves portability.

But remember:

Platform-independent Java bytecode does not mean every application is automatically portable.

If your program depends on:

  • OS-specific files
  • native libraries
  • platform-specific commands
  • hardcoded paths

then portability can still be reduced.


6.5 Secure#

Java includes several mechanisms that contribute to safer application execution.

Examples include:

  • bytecode verification
  • controlled memory access
  • runtime type checking
  • class-loading mechanisms
  • absence of unrestricted pointer arithmetic in normal Java code

However:

"Java is secure" does not mean "every Java application is automatically secure."

Developers can still introduce:

  • SQL injection
  • broken authentication
  • insecure deserialization
  • incorrect authorization
  • leaked credentials
  • vulnerable dependencies

Language/runtime security and application security are different concerns.


6.6 Robust#

A robust application handles errors and unexpected conditions reliably.

Java supports robustness through mechanisms such as:

  • strong type checking
  • exception handling
  • automatic memory management
  • runtime checks

Example:

Java
try {
    int value = Integer.parseInt("abc");
} catch (NumberFormatException exception) {
    System.out.println("Invalid number");
}

You do not need to understand exceptions completely yet.

The important point is:

Java provides structured mechanisms for detecting and responding to many failures.

6.7 Multithreaded#

A thread represents a path of execution inside a process.

A Java application can perform multiple activities concurrently using threads.

For example:

Output
Web Server

Thread 1 → Request from User A
Thread 2 → Request from User B
Thread 3 → Background processing

Java provides built-in concurrency APIs.

Multithreading is an advanced subject, so we will leave the detailed mechanics for its dedicated chapter.


6.8 Distributed and Network Friendly#

Java has historically provided strong networking capabilities.

Applications can communicate across machines using:

  • sockets
  • HTTP libraries
  • web frameworks
  • messaging systems
  • remote APIs

This became especially important for enterprise systems.


6.9 High Performance Through JVM Optimization#

A common beginner misunderstanding is:

"Java uses a JVM, therefore Java must always be slow."

That is too simplistic.

Modern JVM implementations perform sophisticated runtime optimization.

One important mechanism is JIT compilation.

JIT means:

Just-In-Time compilation

Frequently executed bytecode may be compiled into optimized native machine code during program execution.

Simplified view:

Output
Java Source
   ↓
Bytecode
   ↓
JVM
   ↓
Interpreter / JIT optimization
   ↓
Native machine execution

Actual JVM internals are more sophisticated, but this model is enough for now.


6.10 Automatic Memory Management#

When objects are no longer reachable, Java's garbage collector can eventually reclaim their memory.

Conceptually:

Output
Object created
     ↓
Object used
     ↓
Object becomes unreachable
     ↓
Garbage Collector may reclaim memory

Important:

Garbage collection is automatic memory management, not an immediate "delete object" operation.

6.11 Architecture Neutral#

Java bytecode is not designed around one specific CPU instruction set.

The JVM implementation handles the underlying architecture.

This is another piece of Java's portability story.


6.12 Dynamic#

Some classes can be loaded when the application needs them rather than requiring everything to be statically linked into one executable beforehand.

Java's class-loading system supports dynamic loading behavior.

This becomes relevant when studying:

  • class loaders
  • frameworks
  • reflection
  • application servers
  • plugin systems

Micro-Checkpoint#

At this point, remember:

Output
Java source code is not normally executed directly.

Source Code
   ↓
Compiler
   ↓
Bytecode
   ↓
JVM
   ↓
Execution

This single model will help you understand many upcoming concepts.


7. Java Editions#

A new question naturally appears.

Java is used for everything from desktop applications to enormous enterprise systems.

Does one Java platform specification cover every possible environment in exactly the same way?

Historically, Java has been described through different editions.


7.1 Java SE#

Java SE means:

Java Platform, Standard Edition.

This is the foundation most Java developers learn first.

It provides core language and runtime APIs including areas such as:

  • language fundamentals
  • collections
  • I/O
  • networking
  • concurrency
  • JDBC
  • utility APIs

When you learn:

Java
String
ArrayList
HashMap
Thread
File

you are largely working within Java SE APIs.


7.2 Java EE / Jakarta EE#

Enterprise applications need additional capabilities.

Examples include:

  • web applications
  • REST services
  • persistence
  • transactions
  • dependency injection
  • messaging
  • enterprise security

Historically this platform was called:

Output
Java EE

The ecosystem later transitioned to:

Output
Jakarta EE

For a beginner, remember:

Output
Java SE
    ↓
Core Java platform

Jakarta EE
    ↓
Enterprise specifications built around the Java ecosystem

Spring and Spring Boot are separate frameworks/ecosystems and should not simply be treated as another name for Jakarta EE.


7.3 Java ME#

Java ME means:

Java Platform, Micro Edition.

It was designed for resource-constrained devices and embedded/mobile environments.

Its historical importance is greater than its importance for most modern enterprise Java developers.


8. Java Editions Comparison#

EditionPrimary PurposeTypical Environment
Java SECore Java developmentDesktop, backend foundations, libraries
Java EE / Jakarta EEEnterprise applicationsWeb and enterprise servers
Java MEResource-constrained devicesEmbedded/mobile environments

Practical Decision Rule#

If you are starting Java programming:

Output
Start with Java SE.

Frameworks and enterprise technologies become much easier once the Java SE foundation is strong.


9. Applications of Java#

Now we can ask a practical question:

Where do developers actually use Java?

Java has been used across many domains.


Backend Development#

Java is heavily used for server-side applications.

Common ecosystem examples include:

Output
Java
Spring Framework
Spring Boot
Hibernate
Jakarta EE

A typical flow could look like:

Output
Browser / Mobile App
        ↓
REST API
        ↓
Spring Boot Java Application
        ↓
Database

Banking and Financial Systems#

Java is widely associated with enterprise and financial software because such systems often value:

  • maturity
  • maintainability
  • strong tooling
  • concurrency support
  • large ecosystem
  • long-term support options
  • mature monitoring infrastructure

E-Commerce Systems#

Java can power:

  • product services
  • order processing
  • inventory management
  • payment workflows
  • notification services

Enterprise Applications#

Large organizations often use Java for:

  • HR systems
  • insurance software
  • healthcare platforms
  • billing systems
  • workflow systems
  • internal business applications

Distributed Systems and Microservices#

Java frameworks are commonly used to create distributed backend services.

Example:

Output
API Gateway
   ↓
Order Service
Payment Service
Inventory Service
Notification Service

Each service may be a separate Java application.


Desktop Applications#

Java provides desktop GUI technologies such as Swing and JavaFX.

Desktop development is not Java's only or necessarily dominant modern use, but it remains part of the ecosystem.


10. Java Platform#

We have used the word platform several times.

Before continuing, we need to understand it properly.

A platform is an environment in which software can execute.

For example:

Output
Operating System
Hardware
Runtime Environment
Libraries

Java provides a software execution platform built around the JVM and standard APIs.

That means Java is not merely:

a syntax used to write source code.

It also includes an execution ecosystem.

Conceptually:

Output
Java Language
      +
Java Compiler
      +
Java Virtual Machine
      +
Standard Libraries
      =
Java Platform Ecosystem

11. Java Development Process#

Suppose a customer gives us this requirement:

Display "Hello Java" on the screen.

How does that requirement become a running Java program?

The simplified development process is:

Output
Requirement
   ↓
Write Java Source Code
   ↓
Save .java File
   ↓
Compile using javac
   ↓
Generate .class Bytecode
   ↓
Run using java command
   ↓
JVM Executes Program
   ↓
Output

We will now understand each part individually.


12. Java Source Code#

The code written by a developer is called source code.

Example:

Java
public class HelloJava {

    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}

Save it as:

Output
HelloJava.java

The .java extension identifies a Java source file.

Important distinction:

Output
HelloJava.java

contains source code.

After compilation:

Output
HelloJava.class

contains Java bytecode.

They are not the same file.


13. What Is Compilation?#

The computer does not directly treat our .java source file as JVM bytecode.

Something must translate it.

That translator is the Java compiler.

Java Compilation#

Compilation is the process of converting Java source code into Java bytecode.

The compiler commonly used from the JDK is:

Output
javac

Example:

Terminal
javac HelloJava.java

If compilation succeeds, a class file is generated:

Output
HelloJava.class

14. What Is Bytecode?#

This is one of the most important Java concepts.

A beginner may ask:

Why doesn't javac simply produce Windows machine code?

Because Java uses an intermediate representation.

Bytecode#

Bytecode is the instruction format produced by the Java compiler for execution by a compatible JVM.

Simplified flow:

Output
HelloJava.java
     ↓
   javac
     ↓
HelloJava.class
     ↓
Bytecode

Bytecode is not Java source code.

It is also not simply native Windows or Linux machine code.

It is designed for the JVM execution model.


15. Why Bytecode Matters#

Suppose javac produced Windows-specific machine code.

Then Linux could not necessarily execute the same binary.

Instead Java uses:

Output
Source
   ↓
Bytecode
   ↓
Platform-specific JVM

Each operating system can have its own JVM implementation capable of executing compatible bytecode.

So:

Output
           Java Bytecode
          /      |       \
         /       |        \
Windows JVM   Linux JVM   macOS JVM
     ↓           ↓            ↓
Windows      Linux         macOS

This architecture is central to Java portability.


16. A New Concept Has Appeared: JVM#

Until now, we have repeatedly said that bytecode runs through the JVM.

If JVM remains unclear, everything after this point will become confusing.

So we should understand it now.

JVM — Java Virtual Machine#

JVM stands for:

Java Virtual Machine

A JVM is the runtime execution engine responsible for executing Java bytecode and providing important runtime services.

Think of it conceptually as a layer between:

Output
Java bytecode

and:

Output
Operating system / hardware

Simplified model:

Output
Java Bytecode
      ↓
     JVM
      ↓
Operating System
      ↓
Hardware

17. Is the JVM the Same on Every Platform?#

No.

This is a very important interview point.

The bytecode can be platform-independent, but the JVM implementation itself interacts with a particular platform.

For example:

Output
Windows JVM → built for Windows
Linux JVM   → built for Linux
macOS JVM   → built for macOS

Therefore:

JVM implementations are platform-specific, while compatible Java bytecode is designed to be portable across JVM-supported platforms.

This is a much stronger answer than simply saying:

"JVM is platform independent."

That statement can be misleading.


18. What Does the JVM Do?#

At a high level, the JVM is responsible for areas such as:

  • loading classes
  • verifying bytecode
  • managing runtime memory
  • executing bytecode
  • garbage collection
  • runtime type checks
  • exception handling infrastructure
  • thread management
  • runtime optimization

A simplified internal flow is:

Output
.class File
    ↓
Class Loading
    ↓
Bytecode Verification
    ↓
Runtime Structures
    ↓
Execution Engine
    ↓
Program Executes

We will study the deeper JVM architecture later.


19. A New Question: If JVM Runs Java, What Is JRE?#

This is where beginners frequently become confused.

They hear:

Output
JDK
JRE
JVM

and memorize three definitions without understanding how they relate.

Instead, think about what a user needs.

If someone only wants to run a Java program, they need runtime capabilities.

This leads us to the concept historically described as the JRE.

JRE — Java Runtime Environment#

JRE stands for:

Java Runtime Environment

Conceptually, the JRE provides the environment required for running Java applications.

Traditional teaching model:

Output
JRE
│
├── JVM
└── Runtime Libraries

So:

JVM performs bytecode execution.

while:

JRE represents the broader runtime environment surrounding it.

20. Another Problem Appears: Running Is Not Enough#

A developer does not only run Java applications.

A developer must also:

  • compile source code
  • inspect tools
  • package applications
  • debug
  • generate documentation
  • use development utilities

Therefore, developers need a larger toolset.

That brings us to JDK.


21. JDK — Java Development Kit#

JDK stands for:

Java Development Kit

The JDK contains the tools required for Java development.

Common tools include:

Output
javac
java
javadoc
jar
javap

At a conceptual beginner level:

Output
JDK
│
├── Java runtime capabilities
├── Compiler
└── Development tools

A developer normally installs a JDK.


22. JDK vs JRE vs JVM#

Now we can compare them without memorization.

ConceptFull FormMain Role
JVMJava Virtual MachineExecutes Java bytecode
JREJava Runtime EnvironmentRuntime environment for Java applications
JDKJava Development KitDevelopment tools plus runtime capabilities

Traditional conceptual relationship:

Output
JDK
│
├── Development Tools
│   ├── javac
│   ├── jar
│   ├── javadoc
│   └── ...
│
└── Runtime Environment
    │
    ├── JVM
    └── Runtime Libraries

Memory Hook#

Remember:

Output
Want to DEVELOP?
→ JDK

Want to RUN?
→ Runtime capabilities

Who EXECUTES bytecode?
→ JVM

23. Important Modern JDK Note#

Older Java teaching material often treats a separately installed standalone JRE as a standard deployment assumption.

Modern Java distributions and deployment practices have evolved.

Today, developers commonly install a JDK, and production runtimes may be created or packaged differently depending on the distribution and deployment model.

Therefore, understand JDK, JRE, and JVM primarily as conceptual roles rather than assuming every modern Java installation must have three physically nested folders exactly matching old diagrams.

This is an important distinction between:

Output
Conceptual architecture

and:

Output
Modern distribution packaging

24. Platform Independence#

We now have all the pieces needed to understand one of Java's most famous characteristics.

Suppose you compile:

Output
HelloJava.java

into:

Output
HelloJava.class

The class file contains bytecode.

A compatible JVM can execute that bytecode on different supported platforms.

Therefore:

Output
               HelloJava.class
                     ↓
        ┌────────────┼────────────┐
        ↓            ↓            ↓
 Windows JVM     Linux JVM     macOS JVM
        ↓            ↓            ↓
    Windows        Linux         macOS

That is Java's basic platform-independence model.


25. Write Once, Run Anywhere#

You may now understand Java's famous expression:

Write Once, Run Anywhere

Often abbreviated:

Output
WORA

Meaning:

Write and compile Java code into portable bytecode, then run it on compatible platforms with suitable Java runtime support.

But be careful.

WORA does not mean:

Every Java application automatically works everywhere without any changes.

Platform-specific dependencies can break portability.

Examples:

Java
String path = "C:\\company\\reports\\report.txt";

This path assumes Windows conventions.

Another example:

Java
Runtime.getRuntime().exec("some-os-specific-command");

Now your application depends on an operating-system command.

So the correct production mindset is:

Java provides strong platform portability, but application design can still introduce platform dependencies.

26. Java Compilation Process#

Let us now slow down and trace exactly what happens.

Suppose we create:

Java
public class Calculator {

    public static void main(String[] args) {
        int result = 10 + 20;
        System.out.println(result);
    }
}

Saved as:

Output
Calculator.java

We compile it:

Terminal
javac Calculator.java

Conceptually:

Output
Calculator.java
      ↓
Lexical / Syntax / Semantic Analysis
      ↓
Java Compiler
      ↓
Bytecode Generation
      ↓
Calculator.class

If the source code violates Java language rules, compilation fails.

Example:

Java
int number = "Hello";

This attempts to assign a String value to an int.

The compiler detects the incompatible types.


27. Compile-Time Error#

A compile-time error is an error detected while the source code is being compiled.

Example:

Java
public class Demo {

    public static void main(String[] args) {
        int number = "Java";
    }
}

This cannot be compiled successfully because:

Output
"Java"

is a String, while:

Output
number

expects an int.

The program therefore does not reach normal execution.


28. Java Execution Process#

Compilation is only the first half.

Once we have:

Output
Calculator.class

we can run it:

Terminal
java Calculator

Notice:

Output
java Calculator

not:

Output
java Calculator.class

The launcher locates the class and starts the Java runtime.

Simplified execution:

Output
java Calculator
      ↓
JVM starts
      ↓
Class is located
      ↓
Class is loaded
      ↓
Bytecode is checked/prepared
      ↓
main() is invoked
      ↓
Instructions execute
      ↓
Output appears

Output:

Output
30

29. Compilation vs Execution#

This difference is extremely important.

CompilationExecution
Source code is processedCompiled program runs
.java is inputcompiled class/runtime inputs are used
javac is commonly usedjava launcher is commonly used
bytecode may be generatedJVM executes the application
compile-time errors can appearruntime errors can appear

Memory Rule#

Output
javac = compile

java = run

30. Compile-Time vs Runtime#

We have just introduced another important distinction.

Compile Time#

Compile time is when source code is being checked and transformed by the compiler.

Example error:

Java
int value = "Hello";

Detected before normal execution.


Runtime#

Runtime is when the compiled application is actually executing.

Example:

Java
public class Demo {

    public static void main(String[] args) {
        int number = 10 / 0;
        System.out.println(number);
    }
}

This source can compile.

But during execution, integer division by zero causes:

Output
ArithmeticException

So:

Output
Compilation succeeds
        ↓
Program starts
        ↓
Problem occurs during execution
        ↓
Runtime exception

31. Java Program Lifecycle#

Now we can connect the entire journey.

Output
1. Requirement
       ↓
2. Developer writes source code
       ↓
3. Source saved in .java file
       ↓
4. javac compiles source
       ↓
5. Bytecode stored in .class file
       ↓
6. java command launches application
       ↓
7. JVM loads required classes
       ↓
8. Bytecode is prepared/executed
       ↓
9. Runtime services support execution
       ↓
10. Program finishes

In a real enterprise project, many additional stages may exist:

Output
Write
↓
Build
↓
Unit Test
↓
Package
↓
Deploy
↓
Run
↓
Monitor

But the fundamental Java lifecycle remains based on the same core model.


32. Before Writing Our First Program, We Need Java Installed#

You now understand what the JDK is conceptually.

The next practical step is to install one.

A JDK distribution contains the tools we need to develop Java programs.

Different JDK distributions exist, but they implement compatible Java standards.

When choosing one for a real project, teams typically consider:

  • Java version
  • vendor/distribution
  • support policy
  • licensing
  • operating system
  • CPU architecture
  • organization's production standards

For learning purposes, the important requirement is:

Install a suitable JDK and confirm the java and javac commands work.

33. Installing JDK#

The exact installer screens depend on the JDK distribution and operating system.

Conceptually the process is:

Output
Choose JDK Distribution
        ↓
Choose Java Version
        ↓
Choose Operating System
        ↓
Choose CPU Architecture
        ↓
Install / Extract JDK
        ↓
Configure environment if necessary
        ↓
Verify java
        ↓
Verify javac

After installation, locate the JDK directory.

A typical Windows path might resemble:

Output
C:\Program Files\Java\jdk-XX

The exact location depends on your distribution and version.


34. Checking Java Version#

Open:

Output
Command Prompt

or another terminal.

Run:

Terminal
java -version

This checks the Java runtime/launcher version available from your current command environment.

Then check the compiler:

Terminal
javac -version

If both commands work, your development environment is generally on the right track.


35. Why Can java Work While javac Does Not?#

This is a useful debugging question.

Suppose:

Terminal
java -version

works.

But:

Terminal
javac -version

fails.

One possible reason is that your environment exposes runtime tooling but not the JDK compiler location you expect.

Another possibility is:

Output
PATH configuration problem

We therefore need to understand environment variables.


36. What Is an Environment Variable?#

An environment variable is a named configuration value available to processes in the operating system.

Examples:

Output
PATH
JAVA_HOME

These values can help applications locate software installations.


37. What Is PATH?#

Suppose you enter:

Terminal
javac HelloJava.java

How does the operating system know where javac is located?

It searches directories configured in:

Output
PATH

If your JDK's bin directory is included in PATH, the command can normally be found from many working directories.

For example:

Output
C:\Program Files\Java\jdk-XX\bin

may be included in PATH.


38. What Is JAVA_HOME?#

Another widely used environment variable is:

Output
JAVA_HOME

JAVA_HOME usually points to the JDK installation root.

Example:

Output
JAVA_HOME=C:\Program Files\Java\jdk-XX

Notice:

Output
JAVA_HOME

typically points to:

Output
jdk-XX

not:

Output
jdk-XX\bin

Then PATH can include:

Output
%JAVA_HOME%\bin

Conceptually:

Output
JAVA_HOME
   ↓
JDK Root

PATH
   ↓
JAVA_HOME/bin
   ↓
java, javac and other command-line tools

39. JAVA_HOME vs PATH#

These are commonly confused.

VariablePurpose
JAVA_HOMEIdentifies the JDK installation root for tools that use it
PATHTells the operating system where executable commands can be found

Example:

Output
JAVA_HOME
C:\Program Files\Java\jdk-21

and:

Output
PATH
%JAVA_HOME%\bin

40. Common Environment Configuration Mistake#

Risky Configuration#

Output
JAVA_HOME=C:\Program Files\Java\jdk-21\bin

Why is this commonly wrong?

Because tools expecting JAVA_HOME generally expect the JDK root.

Preferred#

Output
JAVA_HOME=C:\Program Files\Java\jdk-21

Then:

Output
PATH=%JAVA_HOME%\bin;...

41. First Java Program#

Now the environment is ready.

Before seeing the code, understand our requirement.

We want Java to print:

Output
Hello Java

That is all.

We deliberately start with the smallest useful program.

Create:

Output
HelloJava.java

Then write:

Java
public class HelloJava {

    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}

Do not try to memorize this immediately.

Several new concepts just appeared.

We will unpack them one by one.


42. public class HelloJava#

Start with:

Java
public class HelloJava

The keyword:

Java
class

declares a class.

Its name is:

Output
HelloJava

At this stage, think of a class as a container that organizes our program.

The keyword:

Java
public

is an access modifier.

It affects accessibility.

Access modifiers are a larger topic and will be taught properly later.

For now, remember only:

public class HelloJava declares a publicly accessible class named HelloJava.

43. Why Must the File Be Named HelloJava.java?#

When a source file contains a top-level public class named:

Java
HelloJava

the source filename is expected to match that public class name:

Output
HelloJava.java

This would be incorrect:

Output
MyProgram.java

if the public top-level class inside is:

Java
public class HelloJava

A compiler error would occur.


44. Curly Braces#

The braces:

Java
{
}

define a block.

Example:

Java
public class HelloJava {
}

Everything belonging to the class body appears between these braces.

Inside the class, our main() method has its own block:

Java
public static void main(String[] args) {
}

45. A New Concept Appears: Method#

Inside the class we wrote:

Java
public static void main(String[] args)

This is a method declaration.

A method represents a named unit of behavior that can execute instructions.

For now:

Output
Class
   ↓
contains
   ↓
Method
   ↓
contains
   ↓
Statements

Our class contains the main() method.


46. Why Is main() Special?#

When we launch a traditional Java application using:

Terminal
java HelloJava

the launcher/JVM needs an entry point for the application.

The familiar entry-point method is:

Java
public static void main(String[] args)

Conceptually:

Output
JVM starts application
      ↓
Find entry point
      ↓
main()
      ↓
Execute statements

47. Understanding public static void main(String[] args)#

This line can intimidate beginners:

Java
public static void main(String[] args)

Let us separate it.

Output
public
static
void
main
String[]
args

public#

Makes the method accessible as required for the normal application-launch contract.


static#

Means the method belongs to the class itself rather than requiring an instance before it can be invoked in the usual way.

Do not worry if this is not fully intuitive yet.

We will learn static properly later.

For now:

The standard main() entry point is declared static so the launcher can invoke it without first creating your application class object.

void#

void means this method does not return a value to its caller.

Example of a method that returns an integer:

Java
int getNumber() {
    return 10;
}

But:

Java
void showMessage() {
    System.out.println("Hello");
}

does not return a value.

Our main() uses:

Java
void

main#

This is the method name:

Java
main

It is the conventional application entry-point name used by the Java launcher.


String[]#

This means:

Output
array of String values

A String represents text.

An array can hold multiple values.

These concepts will be taught properly later.

For now, the launcher can supply command-line arguments as strings.


args#

This is the parameter variable name.

The name is conventional but not magical.

For example, this can also be valid:

Java
public static void main(String[] values) {
}

args is simply the common name.


48. System.out.println()#

Now look at:

Java
System.out.println("Hello Java");

Several new elements appear.

Let us separate them.

Output
System
  ↓
out
  ↓
println()

At a beginner level:

  • System is a standard Java class.
  • out provides access to the standard output stream.
  • println() prints a value and then terminates the line.

So:

Java
System.out.println("Hello Java");

prints:

Output
Hello Java

49. print() vs println()#

Compare:

Java
System.out.print("Hello ");
System.out.print("Java");

Output:

Output
Hello Java

Now:

Java
System.out.println("Hello");
System.out.println("Java");

Output:

Output
Hello
Java

Simplified rule:

Output
print()
→ prints without automatically completing the line

println()
→ prints and completes the line

50. String Literal#

The text:

Java
"Hello Java"

is a String literal.

Quotation marks tell Java that this is text data.

Correct:

Java
System.out.println("Hello Java");

Incorrect:

Java
System.out.println(Hello Java);

Without the quotes, Java does not treat Hello Java as a string literal.


51. Semicolon#

The line:

Java
System.out.println("Hello Java");

ends with:

Output
;

Many Java statements use a semicolon terminator.

Missing it may cause a compilation error.

Incorrect:

Java
System.out.println("Hello Java")

Correct:

Java
System.out.println("Hello Java");

52. Complete First Program Again#

Now the code should look much less mysterious:

Java
public class HelloJava {

    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}

Mental model:

Output
HelloJava class
      ↓
main() entry point
      ↓
println()
      ↓
Hello Java

53. Compiling the Java Program#

Suppose the file is located in:

Output
C:\java-learning

Open a terminal in that folder.

Check the file:

Output
HelloJava.java

Compile:

Terminal
javac HelloJava.java

If successful, you should normally see:

Output
HelloJava.class

The compiler may produce no success message.

That is normal.

Check the folder rather than expecting a message such as:

Output
Compilation successful

54. Running the Java Program#

Now run:

Terminal
java HelloJava

Output:

Output
Hello Java

The important relationship is:

Output
javac HelloJava.java
      ↓
HelloJava.class

java HelloJava
      ↓
JVM runs application
      ↓
Hello Java

55. javac Command#

javac is the Java compiler tool.

Basic syntax:

Terminal
javac FileName.java

Example:

Terminal
javac HelloJava.java

Its job is primarily:

Output
Java Source
    ↓
Compilation
    ↓
Bytecode/Class Files

56. java Command#

The java launcher starts a Java application.

Typical beginner usage:

Terminal
java ClassName

Example:

Terminal
java HelloJava

Notice the difference:

Output
Compile:
javac HelloJava.java

Run:
java HelloJava

This distinction is one of the first things every Java beginner should remember.


57. Prediction Moment#

Look at this program:

Java
public class Demo {

    public static void main(String[] args) {
        System.out.println("A");
        System.out.println("B");
    }
}

Before reading further, predict the output.

The result is:

Output
A
B

Why?

Because each println() completes its line.

Now compare:

Java
public class Demo {

    public static void main(String[] args) {
        System.out.print("A");
        System.out.print("B");
    }
}

Output:

Output
AB

58. Passing Command-Line Arguments#

Remember:

Java
String[] args

We said the launcher can provide command-line arguments.

Consider:

Java
public class Welcome {

    public static void main(String[] args) {
        System.out.println(args[0]);
    }
}

Compile:

Terminal
javac Welcome.java

Run:

Terminal
java Welcome Dattatray

Output:

Output
Dattatray

What happened?

Output
Command:
java Welcome Dattatray

        ↓

args[0]
contains
"Dattatray"

Important: this program assumes at least one argument exists.

If we run:

Terminal
java Welcome

the program can fail at runtime because args[0] does not exist.

That introduces an important beginner lesson:

Code may compile successfully and still fail during execution.

59. Common Beginner Error: javac Not Recognized#

Suppose Windows shows something like:

Output
'javac' is not recognized...

Possible causes include:

  • JDK not installed
  • wrong PATH
  • PATH not refreshed in the terminal
  • incorrect JDK installation path
  • environment configuration pointing somewhere else

Debugging sequence:

Output
Is JDK installed?
       ↓
Locate JDK
       ↓
Check bin directory
       ↓
Check JAVA_HOME
       ↓
Check PATH
       ↓
Open new terminal
       ↓
javac -version

60. Common Beginner Error: Wrong File Name#

Code:

Java
public class HelloJava {

    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

Saved as:

Output
Demo.java

Problem:

Output
public class HelloJava

does not match:

Output
Demo.java

Preferred:

Output
HelloJava.java

61. Common Beginner Error: Running the File Incorrectly#

After compilation, a beginner may write:

Terminal
java HelloJava.class

In traditional class launching, this is incorrect.

Use:

Terminal
java HelloJava

Think:

Output
javac → source filename

java → class name

62. Common Beginner Error: Wrong Capitalization#

Java is case-sensitive.

These identifiers are different:

Output
HelloJava
hellojava
HELLOJAVA

Similarly:

Java
System

is not the same as:

Java
system

Wrong:

Java
system.out.println("Hello");

Correct:

Java
System.out.println("Hello");

63. Common Beginner Error: String vs string#

Wrong:

Java
public static void main(string[] args)

Correct:

Java
public static void main(String[] args)

Java is case-sensitive, and:

Java
String

is the correct standard class name.


64. Common Beginner Error: Misspelling main#

Wrong:

Java
public static void Main(String[] args)

This declares a method named:

Output
Main

not:

Output
main

For the standard launch entry point, use:

Java
public static void main(String[] args)

65. Common Beginner Error: Missing static#

Suppose:

Java
public class Demo {

    public void main(String[] args) {
        System.out.println("Hello");
    }
}

This is a method called main, but it does not match the standard launcher entry-point signature expected for normal execution.

Preferred:

Java
public class Demo {

    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

66. Common Beginner Error: Missing Quotes#

Wrong:

Java
System.out.println(Hello);

Unless a variable named Hello exists, the compiler does not know what Hello refers to.

Correct:

Java
System.out.println("Hello");

67. Common Beginner Error: Missing Semicolon#

Wrong:

Java
System.out.println("Hello")

Correct:

Java
System.out.println("Hello");

This normally becomes a compilation issue.


68. Common Beginner Error: Mismatched Braces#

Wrong:

Java
public class Demo {

    public static void main(String[] args) {
        System.out.println("Hello");
}

One closing brace is missing.

Preferred formatting:

Java
public class Demo {

    public static void main(String[] args) {
        System.out.println("Hello");
    }
}

Indentation helps you see block structure.


69. Common Beginner Error: Compiling from the Wrong Directory#

Suppose:

Output
HelloJava.java

is located in:

Output
C:\java-learning

but your terminal is currently in:

Output
C:\Users\User

Then:

Terminal
javac HelloJava.java

may fail because the compiler cannot find the file in the current directory.

First change directory:

Terminal
cd C:\java-learning

Then compile:

Terminal
javac HelloJava.java

70. Common Beginner Error: Confusing JDK with IDE#

Another common misconception is:

"I installed IntelliJ IDEA / Eclipse / VS Code, so Java must already be installed."

An IDE is a development environment.

Examples:

Output
IntelliJ IDEA
Eclipse
VS Code

A JDK provides Java development/runtime tooling.

They are different things.

Conceptually:

Output
IDE
↓
Helps you write/debug/manage code

JDK
↓
Provides Java compiler/runtime development tools

An IDE can be configured to use an installed JDK.


71. IDE vs JDK vs JVM#

ComponentRole
IDEDeveloper productivity environment
JDKJava development toolkit
JVMBytecode execution engine

A useful mental model:

Output
You
 ↓
IDE / Editor
 ↓
Java Source Code
 ↓
JDK tools
 ↓
Bytecode
 ↓
JVM
 ↓
Running Program

72. How Java Works — Complete Mental Model#

We can now connect everything.

Output
Developer
   ↓
Writes Java source code
   ↓
Example.java
   ↓
javac
   ↓
Bytecode
   ↓
Example.class
   ↓
java launcher
   ↓
JVM
   ↓
Class loading + runtime processing
   ↓
Execution engine
   ↓
Native execution
   ↓
Operating system / hardware

This diagram is the heart of Chapter 1.


73. Internal Working — Beginner Layer#

At the simplest level:

Output
.java
 ↓
javac
 ↓
.class
 ↓
JVM
 ↓
output

If you remember only one internal diagram today, remember this one.


74. Internal Working — Developer Layer#

A little deeper:

Output
Java Source
     ↓
Compiler
     ↓
Bytecode
     ↓
JVM starts
     ↓
Required classes loaded
     ↓
Bytecode verified/prepared
     ↓
Execution engine executes
     ↓
Runtime services manage program

75. Internal Working — More Advanced Preview#

A JVM commonly involves broad subsystems such as:

Output
Class Loader Subsystem
        ↓
Runtime Data Areas
        ↓
Execution Engine
        ↓
Native Interfaces / Libraries where required

Runtime memory areas include concepts such as:

  • heap
  • thread stacks
  • method-related metadata areas
  • program counters
  • native method stacks

Do not attempt to memorize those now.

They belong in JVM architecture and memory-management topics.

For this chapter, understand only:

The JVM is a complete runtime system, not merely a command that prints output.

76. JIT Compilation#

We previously said bytecode is executed by the JVM.

But modern JVM execution is not simply:

Output
Read one bytecode instruction
Execute it
Repeat forever

JVM implementations can optimize frequently executed code.

One important technique is JIT compilation.

Conceptually:

Output
Bytecode
   ↓
Execution begins
   ↓
Frequently executed code detected
   ↓
JIT compiler
   ↓
Optimized native machine code

This can dramatically improve long-running application performance.


77. JVM Startup vs Long-Running Performance#

This introduces an interesting production idea.

A managed runtime like the JVM may spend time:

  • starting
  • loading classes
  • profiling code
  • compiling hot code
  • optimizing execution

Therefore, performance is not always best described by one simple statement such as:

"Java is fast."

or:

"Java is slow."

A better engineering answer is:

JVM performance depends on workload, runtime implementation, startup behavior, optimization, memory configuration, application design, I/O characteristics, and many other factors.

78. Java Source Is Platform Independent — Is That the Best Statement?#

You may hear:

"Java source code is platform independent."

That is incomplete.

The stronger idea is:

Java language source is portable when it avoids platform-specific assumptions, and compiled Java bytecode targets the JVM specification rather than one ordinary native operating-system executable format.

Platform independence is a system-level property involving:

Output
Language rules
+
Bytecode
+
JVM implementations
+
Standard APIs
+
Portable application design

79. Java Is Compiled or Interpreted?#

This is a famous interview question.

Many beginners answer either:

Java is compiled.

or:

Java is interpreted.

Both alone can be oversimplified.

A stronger answer is:

Java source code is compiled into bytecode by the Java compiler. The JVM then executes that bytecode, and modern JVMs may interpret code and/or JIT-compile frequently executed code into native machine code.

Simplified:

Output
Source
 ↓ compilation
Bytecode
 ↓ JVM execution
Interpretation / JIT
 ↓
Machine execution

80. Is Java 100% Object-Oriented?#

Another common interview trap.

Java is strongly object-oriented, but it includes primitive types such as:

Java
int
long
double
boolean
char

Example:

Java
int age = 30;

age is not itself an ordinary object.

Therefore, calling Java "purely object-oriented" requires qualification.

A safer interview answer:

Java is an object-oriented language, but it is not generally considered purely object-oriented because it includes primitive data types and other language constructs outside a strict everything-is-an-object model.

81. Is Java the Same as JavaScript?#

No.

Their names cause frequent beginner confusion.

Output
Java
≠
JavaScript

They are distinct programming languages with different:

  • type systems
  • runtimes
  • syntax rules
  • ecosystems
  • typical execution environments
  • historical origins

Do not assume that learning Java automatically means learning JavaScript.


82. Production Perspective#

Chapter 1 may look basic, but misunderstandings here can cause real production problems.

A production Java developer should understand several fundamentals.


Java Version Matters#

A project may target a specific Java version.

Using an API introduced in a newer Java version can break compilation or deployment against an older target.

Never assume:

Output
Works on my machine
=
Works in production

JDK Distribution Matters Operationally#

Organizations may standardize on specific JDK distributions based on:

  • support
  • licensing
  • security updates
  • certification
  • infrastructure compatibility

Environment Configuration Matters#

Incorrect:

Output
JAVA_HOME
PATH

can cause build tools and IDEs to use different JDK versions.

This can create confusing failures.


Build and Runtime Versions Must Be Compatible#

Imagine:

Output
Developer compiles using newer Java target
        ↓
Production has incompatible older runtime
        ↓
Application fails to start

This is why teams deliberately manage:

  • compiler target
  • runtime version
  • build configuration
  • CI/CD environment
  • container image

83. Wrong vs Preferred: Hardcoding OS-Specific Paths#

Risky#

Java
String file = "C:\\reports\\data.txt";

Why risky?

Because the path assumes Windows conventions.

More Portable Thinking#

Applications often use platform-aware path APIs and configuration instead of hardcoding environment-specific filesystem assumptions.

A later Java I/O chapter will teach this properly.

The lesson here is:

Platform independence can be reduced by application-level choices.

84. Wrong vs Preferred: Assuming java -version Proves Everything#

Suppose:

Terminal
java -version

works.

A beginner may conclude:

"My Java development setup is complete."

Not necessarily.

Also check:

Terminal
javac -version

because development requires compiler tooling.


85. Wrong vs Preferred: Memorizing JDK/JRE/JVM#

Weak Learning#

Output
JDK = development
JRE = runtime
JVM = virtual machine

You may memorize this and still understand nothing.

Strong Understanding#

Output
I write source code
      ↓
I need compiler/tools
      ↓
JDK

Compilation produces bytecode
      ↓
I need execution environment
      ↓
runtime capabilities

Bytecode must actually execute
      ↓
JVM

Understanding relationships is more valuable than memorizing isolated definitions.


86. Important Edge Cases and Traps#

Trap 1 — Compilation Success Does Not Guarantee Runtime Success#

Example:

Java
public class Demo {

    public static void main(String[] args) {
        System.out.println(args[0]);
    }
}

Compiles.

But:

Terminal
java Demo

with no argument may fail at runtime.


Trap 2 — Platform Independence Is Not Absolute#

Java bytecode portability does not neutralize every platform-specific dependency.


Trap 3 — JVM Is Not Bytecode#

Bytecode:

Output
instructions

JVM:

Output
runtime that executes those instructions

Trap 4 — JVM Is Not the JDK#

JVM:

Output
execution

JDK:

Output
development toolkit

Trap 5 — IDE Is Not Java#

An editor/IDE assists development but is not itself the Java language or JVM.


Trap 6 — .java Is Not .class#

Output
.java
→ source

.class
→ compiled class/bytecode representation

87. Decision Rules#

Use these rules during development and interviews.

Output
Need to write and compile Java?
→ Use a JDK.

Need to compile source manually?
→ javac

Need to launch a compiled Java application?
→ java

Need to identify installed launcher/runtime version?
→ java -version

Need to identify compiler version?
→ javac -version

Need operating system to find Java commands?
→ PATH

Need tools to know the JDK installation root?
→ JAVA_HOME

Need portable Java execution model?
→ bytecode + compatible JVM

88. Complete Revision#

You have now covered the complete foundation of this chapter.

Let us compress the chapter into a fast revision system.


One-Line Definitions#

Java: A general-purpose, class-based, object-oriented programming language and platform centered around the JVM ecosystem.

Source Code: Human-readable Java program stored in .java files.

Compiler: Software that converts Java source code into bytecode.

Bytecode: JVM-oriented intermediate instructions typically stored in .class files.

JVM: Runtime engine responsible for executing Java bytecode.

JRE: Conceptual/runtime environment required for Java application execution.

JDK: Java development toolkit containing compiler and development/runtime tooling.

javac: Java compiler command.

java: Java application launcher.

Platform Independence: Ability of compatible Java bytecode/application code to execute across supported platforms through appropriate JVM implementations.

WORA: Write Once, Run Anywhere.

PATH: Environment variable used by the operating system to locate executable commands.

JAVA_HOME: Common environment variable identifying the JDK installation root.


89. Core Syntax to Remember#

Java
public class HelloJava {

    public static void main(String[] args) {
        System.out.println("Hello Java");
    }
}

Compile:

Terminal
javac HelloJava.java

Run:

Terminal
java HelloJava

90. Complete Compilation and Execution Flow#

Output
HelloJava.java
      ↓
javac
      ↓
HelloJava.class
      ↓
java HelloJava
      ↓
JVM
      ↓
Class loading
      ↓
Bytecode execution / runtime optimization
      ↓
Operating System / Hardware
      ↓
Output

91. Important Comparisons#

.java vs .class#

.java.class
Source codeCompiled representation
Written/read by developerPrimarily consumed by JVM/tooling
Input to compilerResult of compilation
Human-friendlyBytecode representation

javac vs java#

javacjava
CompilerLauncher
Compiles sourceStarts application
Common input: .javaCommon input: class/module/JAR launch configuration
Produces class filesExecutes application through runtime

JDK vs JVM#

JDKJVM
Development toolkitExecution engine/runtime abstraction
Contains developer toolsExecutes bytecode
Includes javacDoes not mean "Java compiler"
Used during developmentEssential to Java execution model

Compile-Time vs Runtime#

Compile-TimeRuntime
Code is compiledApplication executes
Language/type errors may appearRuntime exceptions/problems may appear
Before executionDuring execution

92. If You Remember Only 10 Things#

  1. Java source code is normally stored in .java files.
  2. javac compiles Java source.
  3. Compilation produces JVM bytecode/class files.
  4. The JVM executes Java bytecode.
  5. java launches Java applications.
  6. The JDK provides Java development tooling.
  7. Java portability comes largely from bytecode plus platform-specific JVM implementations.
  8. JAVA_HOME usually identifies the JDK root; PATH helps locate commands such as java and javac.
  9. Java is case-sensitive.
  10. Compilation success does not guarantee runtime success.

93. Memory Hooks#

Output
JDK
→ Develop

JVM
→ Execute

javac
→ Compile

java
→ Launch

.java
→ Source

.class
→ Bytecode representation

PATH
→ Find commands

JAVA_HOME
→ Find JDK

94. Final Knowledge Map#

Output
Introduction to Java
│
├── Java Foundation
│   ├── What is Java?
│   ├── History
│   ├── Features
│   └── Applications
│
├── Java Editions
│   ├── Java SE
│   ├── Java EE / Jakarta EE
│   └── Java ME
│
├── Java Platform
│   │
│   ├── Source Code
│   │   └── .java
│   │
│   ├── Compiler
│   │   └── javac
│   │
│   ├── Bytecode
│   │   └── .class
│   │
│   ├── JVM
│   │   ├── Class Loading
│   │   ├── Runtime Execution
│   │   ├── Runtime Memory
│   │   ├── Garbage Collection
│   │   └── JIT Optimization
│   │
│   ├── JRE
│   │   └── Runtime Concept
│   │
│   └── JDK
│       ├── javac
│       ├── java
│       └── Development Tools
│
├── Platform Independence
│   ├── Bytecode
│   ├── Platform-specific JVM
│   └── Write Once, Run Anywhere
│
├── Development Process
│   ├── Write
│   ├── Compile
│   ├── Generate Bytecode
│   └── Execute
│
├── Environment Setup
│   ├── Install JDK
│   ├── java -version
│   ├── javac -version
│   ├── JAVA_HOME
│   └── PATH
│
├── First Program
│   ├── class
│   ├── main()
│   ├── System.out.println()
│   ├── Compile
│   └── Run
│
└── Debugging Foundation
    ├── Compile-Time Errors
    ├── Runtime Errors
    ├── Wrong File Name
    ├── Wrong Command
    ├── Case Sensitivity
    ├── PATH Problems
    └── Version Problems

Practice lab

Prove what you just learned