What is Java? History, Features, Editions and Uses

Introduction

This tutorial answers the question what is Java? - and gives you the big picture before you write your first line of Java code. We will start with what the Java programming language and the Java platform are, and how Java's write once, run anywhere idea works. We will then take a quick trip through Java's history, look at the key features that made Java popular, and understand the different Java editions. Lastly, we will see where Java is used today and run a small Java program which tells us where it is running.

(Note - This is the first tutorial in the Java Fundamentals series on JavaBrahman. The series starts from the very basics, so no prior knowledge of Java is assumed.)

What is Java?

Java is a general-purpose, object-oriented programming language which is also a complete platform for running programs. When people say "Java", they usually mean one of these two things -
  • Java the language: The syntax and rules you use to write programs - classes, methods, variables, loops and so on. Java code is written in plain text files which end with .java.
  • Java the platform: The software which runs Java programs. Its heart is the Java Virtual Machine (JVM), along with a large standard library of ready-made classes for working with text, files, networks, dates, collections of data and much more.
Java is one of the most widely used programming languages in the world. It is used to build everything from banking systems and e-commerce websites to Android apps and big data tools.

How Java works - Write Once, Run Anywhere

Most languages of Java's early days, such as C and C++, were compiled directly into the machine code of one specific processor and operating system. A program compiled for Windows would not run on Linux or macOS - it had to be re-compiled for each one.

Java took a different approach. Java source code is compiled into an intermediate form called bytecode, which is stored in .class files. Bytecode is not tied to any processor or operating system. It is run by the Java Virtual Machine, and there is a JVM available for every major operating system. The steps are -
  1. You write the source code in a file such as Greeting.java.
  2. The Java compiler, javac, compiles it into bytecode - Greeting.class.
  3. The java launcher starts a JVM, which loads Greeting.class and runs it on the machine it is installed on.
Because the same .class file runs on any machine which has a JVM, Java's famous promise is "Write Once, Run Anywhere" (WORA). The JVM takes care of the differences between operating systems so that your program does not have to.

A short history of Java

Java began in 1991 as the Green Project at Sun Microsystems, led by James Gosling. The team wanted a language for programming consumer devices such as set-top boxes. The language was first named Oak, after an oak tree outside Gosling's office, and was renamed Java in 1995. Here are the milestones worth knowing -

YearMilestone
1991The Green Project starts at Sun Microsystems. The language is called Oak.
1995Oak is renamed Java and announced to the public, with the promise of "Write Once, Run Anywhere".
1996JDK 1.0, the first official release of Java, comes out.
2006-2007Sun releases Java as open source. The open-source implementation is called OpenJDK.
2010Oracle acquires Sun Microsystems, and with it, Java.
2014Java 8 adds lambda expressionsClick to read tutorial on Lambda Expressions and the Streams APIClick to read tutorial on the Streams API - the biggest change to the language since its creation (see all Java 8 featuresClick to read the list of new features in Java 8).
2017Java 9 adds the module systemClick to read tutorial on Java 9 Modules.
2018From Java 10 onwards, a new Java version is released every six months - in March and September.
2021-2025Long-Term Support (LTS) releases Java 17 (2021), Java 21 (2023) and Java 25 (2025) bring records, sealed classes, pattern matching and virtual threads.

Note - Every two years one release is marked as a Long-Term Support (LTS) release, which receives updates for several years. The LTS releases so far are Java 8, 11, 17, 21 and 25. Most companies run their production applications on an LTS release, so these are the versions you will meet most often at work.

Key features of Java

These are the features which made Java popular, and which keep it popular today -
  • Platform independent: Compiled bytecode runs on any operating system which has a JVM, as we saw above.
  • Object-oriented: Java programs are built from classes and objects, which model real-world things such as an Employee or an Order. This makes large programs easier to organize and reuse.
  • Simple and familiar: Java's syntax is similar to C and C++, but it leaves out their most error-prone parts, such as pointers and manual memory management.
  • Robust: Java is strongly typed, so many mistakes are caught by the compiler before the program runs. It also has built-in exception handling for dealing with errors at runtime.
  • Automatic memory management: You create objects, and the JVM's garbage collector frees the memory of objects which are no longer used. There is no need to free memory by hand.
  • Secure: Java has no pointers which can access arbitrary memory, checks array bounds, and verifies bytecode before running it.
  • Multithreaded: Java has built-in support for running several tasks at the same time, using threads. Since Java 21, lightweight virtual threads make it possible to run millions of them.
  • High performance: The JVM's Just-In-Time (JIT) compiler converts frequently used bytecode into native machine code while the program runs, so long-running Java programs run very fast.
  • Huge ecosystem: Besides its large standard library, Java has thousands of open-source libraries and frameworks, such as Spring, Hibernate and JUnit, and mature tools such as IntelliJ IDEA, Eclipse, Maven and Gradle.

Java editions - Java SE, Jakarta EE, Java ME and Java Card

Java comes in several editions, each aimed at a different kind of application -
  • Java SE (Standard Edition): The core Java platform - the language, the JVM and the standard library. This is the edition you learn first, and the one this Java Fundamentals series covers. Desktop programs, command-line tools and most server applications run on Java SE.
  • Jakarta EE (formerly Java EE): A set of specifications built on top of Java SE for large enterprise applications - web applications, REST APIs, database access with JPA, messaging and so on. It was called J2EE and then Java EE, until Oracle handed it over to the Eclipse Foundation, where it was renamed Jakarta EE in 2018.
  • Java ME (Micro Edition): A smaller version of Java for devices with limited memory and processing power, such as older mobile phones and embedded devices.
  • Java Card: A tiny version of Java which runs on smart cards, such as SIM cards and bank cards.

Where is Java used?

Java runs in more places than most people realize. Some of the major areas are -
  • Enterprise and back-end applications: Banks, insurance companies, airlines and online retailers run large parts of their business on Java. Frameworks such as Spring Boot are among the most popular ways of building web services and microservices.
  • Cloud applications: Java services run on all the major clouds, often packaged in containers.
  • Android apps: Android apps are written in Java or Kotlin, and Android's application framework is built on Java APIs.
  • Big data and messaging: Widely used data tools such as Apache Hadoop, Apache Kafka, Elasticsearch and Apache Cassandra are written in Java and run on the JVM.
  • Financial systems: Trading platforms and payment systems use Java for its speed, reliability and mature tooling.
  • Developer tools and games: IDEs such as IntelliJ IDEA and Eclipse are written in Java, and so is the original edition of Minecraft.
Note - The JVM also runs other languages, such as Kotlin, Scala and Groovy. These languages compile to the same bytecode, so they can use any Java library. Learning Java therefore also opens the door to the whole JVM world.

A first look at a Java program

Let us end with a small Java program. You do not need to understand every line yet - we will cover each part in detail in the upcoming tutorials of this series. The program prints a greeting, followed by details of the Java version, the JVM and the operating system it is running on.
A Java program which tells you where it is running
//WhereAmIRunning.java
public class WhereAmIRunning {
  public static void main(String[] args) {
    System.out.println("Hello from Java!");
    System.out.println("Java version : " + System.getProperty("java.version"));
    System.out.println("JVM          : " + System.getProperty("java.vm.name"));
    System.out.println("OS           : " + System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ")");
    System.out.println("CPU cores    : " + Runtime.getRuntime().availableProcessors());
  }
}
 OUTPUT of the above code
Hello from Java!
Java version : 24.0.1
JVM          : Java HotSpot(TM) 64-Bit Server VM
OS           : Windows 11 (amd64)
CPU cores    : 12

Explanation of the code

  • Every Java program is made of classes. This program has one class, WhereAmIRunning, saved in a file with the same name - WhereAmIRunning.java.
  • The main() method is where a Java program starts running.
  • System.out.println() prints a line of text to the console.
  • System.getProperty() reads details which the JVM knows about its environment, such as the Java version and the operating system's name.
  • The output depends on the machine. The output above is from a Windows 11 machine with Java 24. Copy the compiled WhereAmIRunning.class file to a Linux or macOS machine with a JVM, and the very same file runs there and prints that machine's details - Write Once, Run Anywhere in action.

Summary

In this tutorial we first understood that Java is both a programming language and a platform. Next we saw how Java achieves Write Once, Run Anywhere by compiling source code to bytecode which runs on the Java Virtual Machine. We then took a short trip through Java's history from the Green Project to today's six-monthly releases, and went through the key features which made Java popular. We then looked at the four Java editions, and the many areas where Java is used. Lastly, we ran a small Java program which printed details of the machine it was running on. In the next tutorial, we will look closely at the JDK, the JRE and the JVM, and the differences between them.