Java Notes
The complete history of Java programming language — from the Green Project at Sun Microsystems in 1991 to modern Java 21+ LTS releases, covering every major version and milestone.
Understanding Java's history helps you appreciate why certain design decisions were made and why the language looks the way it does today. Java wasn't created in a vacuum — it was born out of frustration with existing languages and a vision for a connected future.
The Origin Story (1991-1995)
The Green Project
In June 1991, James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems started a secret project called the "Green Project". Their goal was to create a language for next-generation smart devices — interactive television set-top boxes.
The requirements were clear:
- Must work on multiple hardware platforms (different chips in different TVs)
- Must be reliable (consumer devices can't crash)
- Must be small (embedded devices had limited memory)
- Must be secure (receiving code over networks)
Why C++ Wasn't Good Enough
James Gosling initially tried to extend C++, but found it:
Oak is Born
Gosling created a new language called "Oak" (named after an oak tree outside his office). Oak had:
- Simplified object model (no multiple inheritance)
- Automatic garbage collection
- Architecture-neutral bytecode format
- Built-in security
// This is what early Oak/Java code looked like (1992-1993)
// The syntax was already very similar to what we use today
public class StarSeven {
public static void main(String[] args) {
System.out.println("Hello from *7 device!");
}
}The Star7 Device
The team built a demo device called the Star7 (*7) — a handheld wireless PDA with a touchscreen that could control home entertainment devices. It was ahead of its time (think iPad in 1992), but the interactive TV market never took off.
Renaming to Java
In 1994, the team realized the World Wide Web was the perfect platform for their technology. The name "Oak" was already trademarked, so they brainstormed new names. After rejecting names like "Silk", "DNA", and "WebRunner", they chose "Java" — inspired by Java coffee from Indonesia.
The Public Launch (1995-1996)
Java 1.0 (January 23, 1996)
Sun Microsystems officially released Java 1.0 with the slogan:
"Write Once, Run Anywhere"
Key features of Java 1.0:
// Java 1.0 already had:
// - Classes and objects
// - Interfaces
// - Packages
// - Exception handling
// - Multithreading
// - Applets (Java in web browsers!)
import java.applet.Applet;
import java.awt.Graphics;
// Java Applets were revolutionary in 1996
public class HelloApplet extends Applet {
public void paint(Graphics g) {
g.drawString("Hello from Java Applet!", 50, 25);
}
}The HotJava Browser
Sun created the HotJava browser to demonstrate Java applets. This was the first web browser to run embedded programs (applets) inside web pages — a revolutionary concept in 1995.
Netscape Integration
The biggest boost came when Netscape Navigator (the dominant browser) agreed to include Java support. Suddenly, millions of users could run Java applets. This made Java viral overnight.
Java Version History — Complete Timeline
Java 1.1 (February 1997)
Major additions:
- Inner classes — classes defined within other classes
- JavaBeans — component architecture
- JDBC — database connectivity
- Reflection — inspect classes at runtime
- RMI — Remote Method Invocation
// Inner classes were new in Java 1.1
public class Outer {
private int x = 10;
class Inner {
void display() {
System.out.println("x = " + x); // Access outer class members
}
}
}Java 1.2 "Playground" (December 1998)
This was such a major release that Sun rebranded it as "Java 2":
- Collections Framework — List, Set, Map interfaces
- Swing GUI — platform-independent UI toolkit
- JIT Compiler — massive performance improvement
- strictfp keyword — portable floating-point behavior
import java.util.*;
// The Collections Framework (Java 1.2) changed everything
public class CollectionsDemo {
public static void main(String[] args) {
List list = new ArrayList(); // No generics yet!
list.add("Java");
list.add("1.2");
System.out.println(list);
}
}Java 1.3 "Kestrel" (May 2000)
- HotSpot JVM became the default (huge performance gains)
- JNDI included in core
- Sound API
- Synthetic proxy classes
Java 1.4 "Merlin" (February 2002)
- assert keyword — for debugging
- Regular expressions —
java.util.regex - NIO (New I/O) — non-blocking I/O operations
- Logging API —
java.util.logging - XML processing — built-in XML parser
import java.util.regex.*;
// Regular expressions arrived in Java 1.4
public class RegexDemo {
public static void main(String[] args) {
String email = "user@example.com";
boolean valid = Pattern.matches(".*@.*\\..*", email);
System.out.println("Valid email: " + valid);
}
}Java 5 "Tiger" (September 2004)
The biggest language change since Java's creation:
- Generics — type-safe collections
- Enhanced for loop (for-each)
- Autoboxing/Unboxing — automatic primitive ↔ wrapper conversion
- Enums — type-safe constants
- Varargs — variable-length arguments
- Annotations — metadata for code
- Concurrency utilities —
java.util.concurrent
import java.util.*;
// Java 5 transformed the language
public class Java5Features {
// Enum (new in Java 5)
enum Day { MONDAY, TUESDAY, WEDNESDAY }
public static void main(String[] args) {
// Generics — no more casting!
List<String> names = new ArrayList<String>();
names.add("Java");
names.add("Tiger");
// Enhanced for loop
for (String name : names) {
System.out.println(name);
}
// Autoboxing
Integer num = 42; // auto-converts int to Integer
int value = num; // auto-converts Integer to int
// Varargs
printAll("Hello", "World", "Java");
}
// Varargs method
static void printAll(String... words) {
for (String word : words) {
System.out.print(word + " ");
}
}
}Java Tiger Hello World Java
Java 6 "Mustang" (December 2006)
- Performance improvements
- Scripting engine (JavaScript via Rhino)
- JDBC 4.0
- Compiler API
- Pluggable annotations
Java 7 "Dolphin" (July 2011)
- Diamond operator —
<>for type inference - try-with-resources — automatic resource management
- Multi-catch exceptions — catch multiple types in one block
- Strings in switch — use String in switch statements
- Binary literals —
0b1010 - Underscores in numbers —
1_000_000
Start of week Million: 1000000
Java 8 (March 2014) — Game Changer
The second-biggest language change after Java 5:
- Lambda expressions — functional programming in Java
- Stream API — functional-style data processing
- Default methods — methods with body in interfaces
- Optional — null-safe container
- Date/Time API —
java.timepackage (replacing broken Date/Calendar) - Method references —
System.out::println
import java.util.*;
import java.util.stream.*;
import java.time.*;
public class Java8Features {
public static void main(String[] args) {
List<String> names = Arrays.asList("Alice", "Bob", "Charlie", "David");
// Lambda expression
names.forEach(name -> System.out.println(name));
// Stream API
List<String> filtered = names.stream()
.filter(n -> n.length() > 3)
.map(String::toUpperCase)
.collect(Collectors.toList());
System.out.println("Filtered: " + filtered);
// New Date/Time API
LocalDate today = LocalDate.now();
System.out.println("Today: " + today);
}
}Alice Bob Charlie David Filtered: [ALICE, CHARLIE, DAVID] Today: 2024-01-15
Java 9 (September 2017)
- Module System (Project Jigsaw) — modular JDK
- JShell — interactive REPL
- Private interface methods
- Improved Stream API —
takeWhile,dropWhile - Factory methods for collections —
List.of(),Map.of()
Java 10 (March 2018)
- Local variable type inference —
varkeyword
// var keyword (Java 10)
var message = "Hello"; // compiler infers String
var numbers = List.of(1, 2, 3); // compiler infers List<Integer>Java 11 LTS (September 2018)
- HTTP Client API — modern HTTP support
- String methods —
isBlank(),strip(),lines(),repeat() - Local-variable syntax for lambdas —
(var x) -> x * 2 - Single-file execution —
java HelloWorld.java(no separate compilation)
Java 12-16 (2019-2021)
Notable features across these releases:
- Switch expressions (Java 12/14)
- Text blocks (Java 13/15) — multi-line strings
- Records (Java 14/16) — immutable data classes
- Sealed classes (Java 15/17)
- Pattern matching for instanceof (Java 14/16)
// Records (Java 16) — immutable data carriers
record Point(int x, int y) {}
// Text blocks (Java 15)
String json = """
{
"name": "Java",
"version": 21
}
""";
// Pattern matching (Java 16)
if (obj instanceof String s) {
System.out.println(s.length()); // s is already cast
}Java 17 LTS (September 2021)
- Sealed classes (finalized)
- Pattern matching for switch (preview)
- Removal of deprecated features (Applets, Security Manager)
Java 21 LTS (September 2023)
The latest Long-Term Support release:
- Virtual Threads (Project Loom) — lightweight concurrency
- Pattern matching for switch (finalized)
- Record patterns
- Sequenced Collections
- String Templates (preview)
Java's Release Cadence
Since Java 9 (2017), Oracle follows a 6-month release cycle:
| Release Type | Frequency | Support | Examples |
|---|---|---|---|
| Feature Release | Every 6 months | 6 months | Java 18, 19, 20, 22 |
| LTS Release | Every 2 years | 8+ years | Java 8, 11, 17, 21 |
Tip for developers: In production, use LTS versions (8, 11, 17, or 21). For learning, use the latest version.
Key Milestones Timeline
| Year | Event |
|---|---|
| 1991 | Green Project starts at Sun Microsystems |
| 1992 | Oak language created, Star7 device built |
| 1994 | Pivoted to the World Wide Web |
| 1995 | Java publicly announced, "Write Once Run Anywhere" |
| 1996 | Java 1.0 released, Netscape adds Java support |
| 2004 | Java 5 — generics, enums, for-each (huge update) |
| 2006 | Java becomes open-source (OpenJDK) |
| 2009 | Oracle acquires Sun Microsystems |
| 2014 | Java 8 — lambdas, streams (massive adoption) |
| 2017 | 6-month release cadence begins |
| 2021 | Java 17 LTS released |
| 2023 | Java 21 LTS — virtual threads revolution |
The Oracle Acquisition (2009)
In 2009, Oracle Corporation acquired Sun Microsystems for $7.4 billion. This was controversial in the Java community because:
- Oracle sued Google over Java usage in Android
- Oracle changed the licensing model for Oracle JDK
- Many developers switched to OpenJDK or alternatives (Amazon Corretto, Azul Zulu)
However, Oracle has maintained Java's development pace and the language continues to evolve rapidly.
Common Mistakes
- Thinking Java is old and irrelevant — Java releases every 6 months with modern features like virtual threads, records, and pattern matching.
- Confusing Java versions — Java 1.5 and Java 5 are the same thing. Sun changed naming from "1.x" to just the number starting with Java 5.
- Not knowing about LTS — Using non-LTS versions in production means losing support in 6 months.
- Assuming Java 8 is "modern Java" — Java 8 was released in 2014. Modern Java (17/21) has records, sealed classes, pattern matching, and virtual threads.
- Thinking Java applets are still relevant — Applets were removed in Java 11. They're only historical interest.
Interview Questions
Q1: Who created Java and when?
Answer: Java was created by James Gosling and his team at Sun Microsystems. Development started in 1991 (as the Green Project), and Java 1.0 was officially released on January 23, 1996. Oracle acquired Sun and Java in 2009.
Q2: What was Java originally called and why was it renamed?
Answer: Java was originally called "Oak", named after an oak tree outside Gosling's office. It was renamed because "Oak" was already a trademark of Oak Technologies. The name "Java" was chosen from a list of suggestions — inspired by Java coffee from Indonesia.
Q3: What are the major LTS versions of Java?
Answer: The Long-Term Support (LTS) versions are Java 8 (2014), 11 (2018), 17 (2021), and 21 (2023). LTS versions receive security updates and patches for 8+ years, making them suitable for production systems.
Q4: What was the most significant update in Java's history?
Answer: Two releases stand out: Java 5 (2004) introduced generics, enums, annotations, and the enhanced for loop — fundamentally changing how Java code is written. Java 8 (2014) introduced lambda expressions and the Stream API — bringing functional programming to Java and changing the programming paradigm.
Q5: Why did Sun Microsystems open-source Java?
Answer: Sun open-sourced Java in 2006 (as OpenJDK under GPL v2) to increase community participation, ensure the language's long-term survival independent of any single company, and compete with open-source alternatives. This decision proved crucial after Oracle's acquisition.
Summary
Java's history spans over three decades — from an embedded systems language for interactive TV to the world's most widely-used enterprise programming language. Understanding this evolution helps you appreciate why Java has certain design choices (like platform independence and strong typing) and why it continues to evolve with modern features while maintaining backward compatibility.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for History of Java.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Java Master Course topic.
Search Terms
java-master-course, java master course, java, master, course, fundamentals, introduction, history
Related Java Master Course Topics