01Overview
In 1991 Sun’s Green project designed Oak for consumer electronics; in 1995 it shipped as Java. Java compiles to bytecode, which the JVM interprets or just-in-time compiles. Garbage collection freed developers from manual memory management, and a large standard library plus enterprise frameworks made it the default for big systems.
The JVM’s real contribution is the idea of a runtime: bytecode runs on different hardware, a JIT optimises hot code using runtime information, and Android’s ART follows the same path. Today Kotlin, Scala and Clojure share the JVM ecosystem, proof that a virtual machine can be a platform for many languages.
02History
- 1991
Project Oak
Designed for consumer electronics.
- 1995
Java is released
Write once, run anywhere.
- 1996
JDK 1.0
The first official release.
- 2006
HotSpot goes open source
JIT compilation and runtime optimisation.
- 2008
Android
Java reaches mobile.
03Core concepts
Bytecode
An intermediate instruction set aimed at a virtual machine.
JIT
Compiling hot bytecode to native code at run time.
Garbage collection
Automatically reclaiming objects that are no longer reachable.
04Hands-on
Do it once — it beats reading it ten times
Compile a small Java class, disassemble it with javap, and explain what the bytecode actually does
05Self-check
Say it in your own words first, then open the answer. Whatever you cannot explain is what to review next.
Can you explain "Bytecode"?
An intermediate instruction set aimed at a virtual machine.
Can you explain "JIT"?
Compiling hot bytecode to native code at run time.
Can you explain "Garbage collection"?
Automatically reclaiming objects that are no longer reachable.
What problem did it solve, and why was there nothing better at the time?
Go back to the history section: how was this done before, and what did it cost?
If you had to build it today, how would you break it down?
Use the hands-on task above: write a plan of at most three steps before you start.
06Key people
James Gosling
1955 –
The father of Java.
Bill Joy
1954 –
Co-founder of Sun; involved in BSD and vi.
07Further reading
- Thinking in Java
- Inside the Java Virtual Machine