Java Core · companion to Unix Core, Spring Core & Service Core

Learn Java from bytecode to production systems

Practical guides for beginners through architects—language fundamentals, OOP, collections, concurrency, JVM internals, and the frameworks teams actually ship with.

Why Java?

Thirty years after Oak, Java remains the default when you need predictable performance, a deep talent pool, and a battle-tested ecosystem—not hype, but trade-offs that still win in banks, Android, and cloud backends.

  • Write Once, Run Anywhere

    Bytecode on the JVM abstracts OS and CPU. Ship one JAR to Linux servers, Windows laptops, and ARM instances without recompiling for each platform.

  • Object-Oriented Programming

    Classes, interfaces, and packages model domain boundaries. Enterprise frameworks assume encapsulation, polymorphism, and clear APIs.

  • Rich Ecosystem

    Maven Central, mature drivers, and first-class clients for Kafka, cloud SDKs, and databases—if it runs in enterprise, there is a Java library.

  • Enterprise-Proven

    Fortune 500 backends, payment rails, and telco cores run on Java. Long-Term Support releases (11, 17, 21) align with multi-year operations contracts.

  • Strong Static Typing

    Compile-time checks catch large classes of defects before deploy. Generics, records, and sealed types push correctness without giving up expressiveness.

Java timeline

Milestones from the first public release to today’s LTS. Enterprises standardize on LTS versions (11, 17, 21); feature releases ship every six months.

  1. 1995

    Java 1.0

    Oak goes public at Sun. Applets, public static void main, and the JVM model that still defines the platform.

  2. 1998–2006

    J2SE / J2EE era

    Java 2 rebranding: J2SE for desktop and server runtime, J2EE for servlets, EJB, and enterprise XML. Collections framework (1.2), assertions (1.4).

  3. 2004

    Java 5 — Generics

    List<T>, enums, annotations, varargs, and java.util.concurrent. Generics change how every API is written.

  4. 2014

    Java 8 — Streams & Lambdas

    Functional interfaces, Stream API, Optional, new date/time, and default methods on interfaces—the dialect most codebases still use daily.

  5. 2018

    Java 11 (LTS)

    Six-month release cadence begins. HTTP Client API, var in local variables (10), modular JDK, and the shift to multiple JDK vendors (Adoptium, Corretto, etc.).

  6. 2021

    Java 17 (LTS)

    Records, sealed classes, pattern matching for instanceof, stronger encapsulation of JDK internals—widely adopted as the “modern baseline.”

  7. 2023

    Java 21 (LTS) — Virtual threads

    Project Loom: platform threads vs virtual threads for massive I/O concurrency. Pattern matching for switch, record patterns, sequenced collections.

Explore the guide — all sections

Fifteen deep-dive chapters plus cheat sheets. Recommended path: JVMFundamentalsOOPCollections, then advanced topics as your role requires.

Learning path: JVM & Platform · Language Fundamentals · OOP · Collections · Generics · Streams · Concurrency

Beginner

beginner

Syntax, OOP basics, collections, exceptions, testing intro.

Mid-Level

mid

Generics, streams, concurrency, I/O, networking, design patterns.

Senior

senior

JVM tuning, performance, modern Java, architecture-level patterns.

Quick start — Hello World, every token explained

Every Java program is a class with a main method. The JVM loads the class, invokes main, and executes bytecode on the heap with a stack frame per method call.

HelloWorld.java
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, Java Core!");
    }
}
TokenWhat it means
public Access modifier—the class is visible outside its package. The launcher must see main.
class Declares a reference type. Keywords cannot be used as identifiers.
HelloWorld Class name (PascalCase). Source file must be HelloWorld.java.
{} Class body—fields, methods, and nested types live inside the braces.
public static void main static — no object exists yet. void — returns nothing. main — JVM entry point name.
(String[] args) Parameter: array of command-line arguments (java HelloWorld arg1 arg2).
System.out System is a final class; out is the standard output PrintStream.
println(...) Prints the string plus a newline. print omits the newline.
"Hello, Java Core!" String literal—immutable String object (often interned in the string pool).
; Statement terminator—required at the end of each statement in Java.
💡 Pro Tip

Run a single source file without a manual compile step: java HelloWorld.java Java 11+. Projects use Maven or Gradle (see ecosystem map).

⚠️ Pitfall

Filename ≠ public class name → compile error. Non-public class with main in another package → “Main method not found in class” at runtime.

Java ecosystem map

Three names confuse newcomers: you write with the JDK, historically ran with a JRE, and always execute on the JVM. Modern JDK downloads bundle all three for deployment and development.

JDK

Full kit: compiler (javac), tooling, libraries, and JVM. Required on CI build agents and developer machines.

JRE

Runtime only—no compiler. Oracle stopped shipping a separate JRE after Java 8; use a slim JRE distribution or container image with just what you need.

JVM

Executes .class bytecode. Implementations: HotSpot (OpenJDK default), GraalVM, Eclipse OpenJ9. Tuned with -Xmx, GC flags, etc.

Frameworks

  • Spring / Spring Boot — dependency injection, web (MVC/WebFlux), security, data access—the default enterprise stack
  • Hibernate / Jakarta Persistence — ORM mapping entities to SQL, second-level cache, query APIs
  • Quarkus — Kubernetes-native, fast startup, GraalVM native-image focus (Red Hat)
  • Micronaut — compile-time DI, low reflection, good for serverless and microservices

Build tools

  • Maven — XML POM, convention-over-configuration, vast plugin ecosystem
  • Gradle — Kotlin or Groovy DSL, incremental builds, multi-module monorepos

Testing

  • JUnit 5 (Jupiter) — unit and integration tests, parameterized tests, extensions
  • Mockito — mocks, stubs, spies; integrates with JUnit via @ExtendWith

Also on the JVM

  • Kafka, Elasticsearch, Spark — JVM services you operate alongside your apps
  • Android (ART) — subset of Java SE on mobile devices
🔬 Under the Hood

javac emits bytecode, not native code. HotSpot interprets cold methods, then JIT-compiles hot paths—why micro-benchmarks need warmup and why production JVM flags matter.

📦 Real World

A typical Spring Boot service: Gradle build → fat JAR → container with a Java 21 runtimeG1 GC flags → JUnit + Mockito in CI → Hibernate to PostgreSQL. Java Core chapters map directly to each layer.