Introduction to Java – A Beginner’s Complete Guide

sumaya
SM
Published on Dec, 29 2025 2 min read 0 comments
image

Introduction

Java is one of the most popular and powerful programming languages in the world.
From enterprise applications and banking systems to Android apps and cloud-based microservices, Java is everywhere.

In this first week of our Weekly Java Blog Series, we’ll cover the foundations of Java, so even absolute beginners can start confidently.

By the end of this article, you will understand:

  • What Java is
  • Why Java is still relevant
  • How Java works internally
  • The difference between JVM, JRE, and JDK
  • How to write your first Java program

What Is Java?

Java is a high-level, object-oriented, platform-independent programming language developed by Sun Microsystems in 1995 (now owned by Oracle).

Key Features of Java

  • Platform Independent
  • Object-Oriented
  • Secure
  • Robust
  • Scalable
  • High Performance

Java follows the philosophy:

Write Once, Run Anywhere (WORA)

This means Java code can run on any system that has a Java Virtual Machine (JVM).

Why Java Is Still Popular in 2025

Despite many new languages, Java remains a top choice because:

  • Used by millions of companies
  • Huge ecosystem & libraries
  • Strong community support
  • Excellent performance
  • Backed by frameworks like:
    • Spring Boot
    • Hibernate
    • Quarkus

Companies Using Java

  • Google
  • Amazon
  • Netflix
  • Uber
  • Banks & Financial Institutions

How Java Works (Simple Explanation)

Java does not run directly on hardware like C or C++.

Java Execution Flow

  1. You write Java code (.java)
  2. Java Compiler converts it into bytecode (.class)
  3. JVM executes the bytecode
  4. Output is produced
Java Source Code → Bytecode → JVM → Output

JVM vs JRE vs JDK (Very Important)

Many beginners get confused here, so let’s simplify it.

JVM (Java Virtual Machine)

  • Executes Java bytecode
  • Makes Java platform-independent
  • Specific to OS (Windows JVM, Linux JVM)

JRE (Java Runtime Environment)

  • JVM + Core Libraries
  • Needed to run Java applications
  • Does NOT include compiler

JDK (Java Development Kit)

  • JRE + Compiler + Tools
  • Needed to develop Java applications

👉 Developers install JDK
👉 Users only need JRE

Installing Java (JDK)

Step 1: Download JDK

Download OpenJDK 17 or 21 (LTS) from:

  • Oracle JDK
  • OpenJDK official builds

Step 2: Verify Installation

Open terminal / command prompt and run:

java -version

If installed correctly, you’ll see the Java version.

Your First Java Program (Hello World)

Let’s write your first Java program 🎉

Step 1: Create a File

Create a file named:

HelloWorld.java

Step 2: Write Code

public class HelloWorld {

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

}

Understanding the Code

Let’s break it down line by line.

public class HelloWorld
  • Defines a class
  • Class name must match file name
public static void main(String[] args)
  • Entry point of Java program
  • JVM starts execution from here
System.out.println("Hello, Java World!");
  • Prints output to console

Compile and Run the Program

Compile

javac HelloWorld.java

Run

java HelloWorld

Output

Hello, Java World!

🎉 Congratulations! You’ve written your first Java program.

Common Beginner Mistakes

  • File name doesn’t match class name
  • Missing semicolon ;
  • Java not added to system PATH
  • Writing code outside main method

Where Java Is Used in Real Life

  • Web Applications – Spring Boot
  • Mobile Apps – Android
  • Enterprise Systems – Banking, ERP
  • Cloud & Microservices
  • Big Data – Hadoop

Summary

In this article, you learned:

  • What Java is
  • Why Java is important
  • How Java works internally
  • JVM vs JRE vs JDK
  • How to write & run your first Java program

This foundation is essential before moving forward.

 

0 Comments