Skip to content

What Is Java? The Language, the JVM, and Why It Endures

Discover what is Java through its architectural internals, JVM execution model, memory management, and the finalized features of Java 25.

Tuan Tran Van
11 min read
Contents (10 sections)
  1. What is Java?
  2. What problem was Java created to solve?
  3. How Java runs: bytecode, the JVM, and write once run anywhere
  4. JIT, garbage collection, and Java performance
  5. Where Java is actually used
  6. The Java ecosystem: JDK, OpenJDK, and the frameworks
  7. Java today: the LTS cycle and what Java 25 brought
  8. What are Java's drawbacks?
  9. When should you choose Java?
  10. References

The short answer to what is Java: Java is a high-level, general-purpose, object-oriented programming language and a software platform designed for the "Write Once, Run Anywhere" (WORA) principle. It is a memory-safe environment that decouples application code from underlying hardware architecture. By compiling source code into intermediate bytecode executed by a virtual machine, Java lets you run the same program across different operating systems without modification.

You should view Java as a dual system: it is both a language with strict syntactic rules and a platform made up of the Java Virtual Machine (JVM) and a large Application Programming Interface (API). This abstraction layer insulates your software from hardware-specific calls, carrying the same code from embedded smart cards to enterprise data centers and supercomputers.

Java runs everywhere, from SIM cards and embedded devices to enterprise servers and supercomputers

What is Java?

Java is two things at once: a language and a software platform. The language itself is a class-based, object-oriented system with a static, strong, and manifest typing discipline. Manifest typing requires you to declare types explicitly, so the compiler can enforce rigorous type checking before execution. As a platform, Java consists of the JVM and a comprehensive class library (API) that provides standardized components for networking, I/O, and data structures.

Java is two things: a programming language, and a platform made of the JVM plus the API class library

The fundamental technical characteristics of the system are architecture neutrality and portability. Because the JVM is ported to nearly every major hardware platform, the same compiled .class files can execute on x86, ARM, or SPARC architectures. The Java Class Library reinforces this portability, offering a uniform interface for system resources regardless of the host operating system.

The language was created by James Gosling at Sun Microsystems and released in 1995. After Oracle Corporation's acquisition of Sun in 2010, Oracle became the steward of the technology. Today, while various commercial distributions exist, the official reference implementation is the open-source OpenJDK. This community-driven project is the foundation for most modern Java runtimes, and it keeps the language evolving through the Java Community Process.

What problem was Java created to solve?

The "Oak" project, which eventually became Java, was engineered to solve the instability and lack of portability inherent in C and C++. James Gosling established five primary design goals for the language: it had to be simple, object-oriented, and familiar; robust and secure; architecture-neutral and portable; high-performance; and interpreted, threaded, and dynamic. These goals were a response to the growing need for a language that could operate reliably in distributed network environments.

To address robustness, the designers eliminated manual pointer arithmetic and direct memory manipulation — the primary causes of memory corruption in C++. By shifting memory management to the runtime environment, Java prevented common vulnerabilities like buffer overflows. The designers went further on security with a sandbox model that let the system execute remote code, such as applets, while restricting unauthorized access to the host's file system or network.

Architecture neutrality was the solution to the high cost of maintaining software across different kinds of hardware. Before Java, porting software often required major source code changes and recompilation. Java's transition from the Oak project to a web-integrated version solved this by using an intermediate bytecode format. This allowed code to execute safely and consistently within any web browser or server environment equipped with a JVM, standardizing software delivery for the early internet.

Before Java you recompiled for each CPU, while with Java one bytecode runs on the JVM on every platform

How Java runs: bytecode, the JVM, and write once run anywhere

The Java execution pipeline transforms human-readable instructions into a format the JVM can optimize. You write source code in .java files, which the javac compiler converts into .class files containing bytecode. Bytecode is the instruction set for the JVM — a universal machine language that is not tied to any physical processor.

The JVM manages the lifecycle of this bytecode through a multi-stage architecture. The Class Loader Subsystem uses a delegation model to ensure security and prevent class collisions; it searches for classes via a hierarchy of the Bootstrap Class Loader (core classes), Platform/Extension Class Loader (standard extensions), and System/Application Class Loader (the application classpath). Once a class is loaded, it goes through Linking, which has three sub-steps:

  1. Verification: Ensuring the bytecode is structurally correct and adheres to JVM security constraints.
  2. Preparation: Allocating memory for static fields and initializing them with default values.
  3. Resolution: Replacing symbolic references in the constant pool with direct memory addresses.

After initialization, the JVM tracks execution using PC Registers for each thread to store the address of the current instruction, while Native Method Stacks handle calls to non-Java libraries (typically C/C++) through the Java Native Interface (JNI).

How a Java program runs: .java source through javac into a .class bytecode file, then the JVM loads classes and the JIT compiles down to machine code for the CPU

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

JIT, garbage collection, and Java performance

To balance portability with performance, the JVM execution engine uses a tiered strategy. It starts with an Interpreter that executes bytecode line by line. But for "hot" code — methods executed frequently — the Just-In-Time (JIT) Compiler converts the bytecode into native machine code. This runtime optimization lets the JVM perform "constant folding" and other transformations that a static compiler might miss, bringing Java's performance close to that of native C++.

A garbage collector (GC) handles memory automatically, managing the Heap, where objects are stored. Each thread has its own Stack Area for local variables and method calls. The GC identifies and reclaims memory from unreachable objects, preventing manual errors like double-free bugs. Modern Java uses the G1GC (Garbage First) algorithm as the default since Java 9, though you can opt for ZGC or Shenandoah for sub-millisecond pause times. Shenandoah is generally unavailable in Oracle-produced OpenJDK builds, but third-party distributions like Eclipse Temurin ship it.

While Java performance has improved sharply since 1997, it still carries architectural overhead compared to C++. Every object in Java has a header that consumes memory, and the GC requires periodic pauses to scan the heap. The reliance on a VM also means a larger initial memory footprint than a direct-to-native binary.

The JIT compiles frequently executed hot code into machine code, while garbage collection splits the heap into a young and an old generation

Where Java is actually used

Java remains the standard for enterprise and back-end environments. It is the primary language for high-volume distributed systems, web servers, and scientific supercomputers. Beyond the server, Java runs in resource-constrained environments via Java ME and Java Card, which powers the logic in smart cards and SIM cards.

In the mobile sector, Java has a unique relationship with Android. The Android SDK uses the Java language and syntax, but it does not use a standard JVM or standard bytecode. Android compiles code into an alternative format for the Dalvik VM or the modern Android Runtime (ART). The Android SDK also uses an independent implementation of the Java SE library (based on Apache Harmony) rather than Oracle's implementation, making it incompatible with standard JVM bytecode.

This implementation led to a legal controversy. Oracle sued Google over the copyrightability of Java APIs in the Android SDK. In April 2021, the U.S. Supreme Court ruled in favor of Google, stating that the use of these APIs constituted fair use. The ruling gave the industry legal clarity about the reuse of software interfaces, though it did not fully resolve the debate over whether APIs can be copyrighted in the first place.

Where Java is used: Java SE, Jakarta EE, Java ME, Android, and server-side

The Java ecosystem: JDK, OpenJDK, and the frameworks

To develop Java applications, you must use the Java Development Kit (JDK), which contains the javac compiler and diagnostic tools. The Java Runtime Environment (JRE), which contains only the JVM and libraries, handles execution. The ecosystem also splits into specific editions:

  • Java SE (Standard Edition): The core platform for general-purpose applications.
  • Jakarta EE (Enterprise Edition): A set of specifications for large-scale, distributed internet systems (formerly Java EE).
  • Java ME (Micro Edition): Optimized for mobile and embedded devices with limited CPU and memory.

The core Class Library provides essential Integration APIs, such as JDBC for database connectivity, JNDI for naming and directory services, and RMI for distributed object invocation. Standard APIs also cover I/O, networking, and reflection.

The strength of Java often lies in its third-party ecosystem. Frameworks like Spring and Hibernate have become the de facto standards for enterprise dependency injection and object-relational mapping, respectively. For web serving, Apache Tomcat remains a common choice for deploying Java-based servlets and JSP applications.

The Java ecosystem as layers: the JDK contains the JRE, the JRE contains the JVM, alongside the Spring, Hibernate and Apache Spark frameworks

Java today: the LTS cycle and what Java 25 brought

Java now operates on a six-month release cycle with Long-Term Support (LTS) versions designated for enterprise stability. The currently supported LTS versions are 8, 11, 17, 21, and the recently released Java 25. Released on September 16, 2025, Java 25 finalized several features from "Project Loom" and "Project Lilliput."

Timeline of the Java long-term support releases: Java 8, Java 11, Java 17, Java 21 and Java 25

A major addition in Java 25 is Scoped Values (JEP 506), which provides a thread-safe, immutable alternative to ThreadLocal. Unlike ThreadLocal, which can cause memory leaks and allows mutation, Scoped Values have a limited, strictly defined scope and are immutable, making them more performant and safer for use with virtual threads. Another performance gain comes from Compact Object Headers (JEP 519), which reduced the object header size from 12 bytes to 8 bytes. Compressing the class pointer to 22 bits made that possible, cutting the memory footprint of applications that manage millions of small objects.

Java 25 also finalized Flexible Constructor Bodies (JEP 513), which lets you execute logic and initialize fields before calling super() or this() in a constructor. That means parameter validation or complex calculations can happen before the parent class is initialized. The release also introduced Compact Source Files and Instance Main Methods, simplifying the entry point for small programs.

java
// Java 25 Compact Source File using the java.lang.IO class
void main() {
    IO.println("Technical accuracy is priority.");
}

What are Java's drawbacks?

Java is frequently criticized for its verbosity and the lack of certain modern language features. Compared to Kotlin, Java lacks native null safety in its type system. If you try to call a method on a null reference, the system throws a NullPointerException. Kotlin's type system, by contrast, forces you to handle nullability at compile time.

There are also functional limitations. Java does not support operator overloading or unsigned integer types, which complicates certain mathematical and systems-level programming tasks. The Java Persistence API (JPA) also draws criticism for its complexity, often requiring high-level abstractions like Spring Data to become manageable for average development teams.

Architectural concerns remain as well. In 2016, researchers provided a formal proof that Java's generics type system is "unsound." This unsoundness means it is possible to construct code that passes all compiler checks but triggers a ClassCastException at runtime by assigning an instance of one class to an unrelated class variable. Finally, even with compact headers, the memory footprint and the non-deterministic nature of GC pauses make Java less suitable for real-time systems compared to C++.

When should you choose Java?

Choose Java when building large-scale, distributed enterprise systems that require long-term stability and a massive library ecosystem. It is the right architectural choice for back-end infrastructure where battle-tested frameworks and a deep pool of engineering talent matter more than concise syntax or raw native performance.

While you might prioritize Kotlin for modern mobile development or C++ for direct hardware control, Java's mature garbage collection, robust threading model, and architectural neutrality make it the benchmark for reliable, cross-platform software engineering.

References

Share this article