Every programming language has an origin story, but few are as unlikely as Java’s. It was born in a secret office above a pizza shop in Menlo Park. It was named after a tree, then renamed after a cup of coffee. It was designed for a market that didn’t want it, saved by a revolution its creators didn’t predict, and eventually became the most widely deployed programming language in history. This is the story of how that happened.
Before We Begin: A Quick Glossary
If you’re new to the Java ecosystem, you’ll encounter a handful of terms throughout this article. Here’s what they mean before we dive in.
- Java — a programming language. A set of rules and syntax for writing instructions that a computer can eventually execute. When people say “I code in Java,” they’re referring to the language itself: its keywords, its structure, its object-oriented philosophy.
- Source code — what a developer actually writes. The human-readable text — the
.javafiles sitting in your project directory. A computer can’t run source code directly. It has to be translated first. - Bytecode — the result of that translation. When you compile a Java source file, you don’t get machine code specific to your processor. Instead, you get an intermediate format — a
.classfile containing bytecode. This is the key to Java’s portability, and we’ll explain exactly why later. - JVM (Java Virtual Machine) — the engine that reads and executes bytecode. A software layer that sits between your compiled Java program and the actual hardware. Each operating system has its own JVM implementation, but they all understand the same bytecode. This is the mechanism that makes “Write Once, Run Anywhere” possible.
- JRE (Java Runtime Environment) — the minimum package you need to run a Java program. It bundles a JVM with a set of core libraries — the standard classes for things like file I/O, networking, and data structures. If you’re a user who just needs to run Java applications, the JRE is all you need.
- JDK (Java Development Kit) — the full toolkit for building Java programs. It includes everything in the JRE, plus the compiler (
javac), debugger, documentation tools, and other development utilities. If you’re writing Java code, you need a JDK.
With those definitions in hand, let’s go back to 1991.
The Green Project: A Secret Team, A Pizza Shop, and a Bet on the Future
In late 1990, Sun Microsystems was riding high. Their SPARC workstations were the backbone of university labs and engineering firms. Their motto — “The Network is the Computer” — was prescient in a world that hadn’t yet grasped what networked computing would become. But inside Sun, a small group of engineers was growing restless. They looked at the consumer electronics market — the televisions, cable boxes, and VCRs proliferating in American living rooms — and saw an opportunity that Sun was ignoring entirely.
Patrick Naughton was one of them. A talented engineer who had grown frustrated with Sun’s direction, Naughton was reportedly on the verge of leaving for NeXT, Steve Jobs’ post-Apple venture. His resignation letter landed on the desk of Sun’s CEO, Scott McNealy, who asked him a simple question: instead of leaving, why not write down everything you think Sun is doing wrong?
Naughton did. And rather than dismiss the critique, McNealy greenlit a small, autonomous research project to explore the future of computing beyond workstations. The initiative was codenamed the Green Project.
In early 1991, a team of about thirteen engineers — led by James Gosling, Mike Sheridan, and Patrick Naughton — moved out of Sun’s main campus and into a rented office at 100 Hamilton Avenue in Menlo Park, California. The office sat above a pizza restaurant. The location was deliberate: physical distance from Sun’s corporate bureaucracy meant intellectual freedom. No status reports. No product roadmaps. Just a mandate to figure out what came next.

The team’s thesis was specific: the next wave of computing wouldn’t happen on desktops. It would happen in the devices people already used every day — televisions, set-top boxes, stereo systems, and appliances. These devices would become smarter, networked, and programmable. The question was what kind of software platform could power that world.
James Gosling, already well known at Sun as the author of the original Emacs text editor for Unix and the NeWS window system, was the team’s language architect. He began working on a new programming language almost immediately. His starting point was C++, which Sun used extensively, but his frustrations with it were deep. C++ gave programmers enormous power, but it also gave them enormous latitude to write dangerous, unportable, crash-prone code. Manual memory management led to memory leaks and dangling pointers. Platform-specific assumptions were baked into every codebase. The language was, in Gosling’s assessment, too complex and too unsafe for the kind of embedded, networked devices they were targeting.
So Gosling started from scratch. He kept C++‘s familiar syntax — the curly braces, the class structures, the general look and feel that would make C and C++ programmers feel at home — but he stripped out everything he considered dangerous or unnecessary:
- No manual memory management. The language would have automatic garbage collection.
- No pointers. References would be managed by the runtime.
- No multiple inheritance of implementation. Interfaces would provide polymorphism without the complexity.
- No preprocessor, no operator overloading, no
gotostatement.
The result was a language designed to be simple, object-oriented, robust, and — crucially — architecture-neutral (it could run on any processor with any architecture, without needing to be recompiled).
Gosling initially called the language Oak, after an oak tree he could see from his office window. It was a working name, chosen without much deliberation, the way engineers name things when they’re focused on the work rather than the marketing.
Star7: The Demo That Dazzled and the Market That Didn’t Care
The Green Project’s first tangible product was a device called the Star7 (or *7), a handheld touchscreen controller for home entertainment systems. Its specs were striking for 1992:
- Roughly the size of a large TV remote.
- Five-inch color LCD touchscreen.
- SPARC microprocessor.
- Wireless networking.
- An animated cartoon agent named Duke who guided users through the device’s functions.
Touchscreen devices were exotic. Wireless networking was barely a concept in consumer electronics. Animated user interfaces were the province of expensive workstations, not handheld controllers. The device ran Gosling’s Oak language on a custom virtual machine, and it demonstrated something powerful: a single software platform could run on small, embedded hardware while still delivering a rich, interactive user experience.
But building an impressive demo and finding a market for it are very different problems.
The Green Project team, now reorganized as a Sun subsidiary called FirstPerson, Inc., pitched their technology to the cable television industry. The timing seemed right: the early 1990s buzzed with talk of “interactive television.” Cable companies like Time Warner were running trials of interactive TV systems that would let viewers order movies on demand, browse program guides, and shop from their sofas. FirstPerson offered Oak and the Star7 platform as the software foundation for set-top boxes that would power this vision.
The pitch failed. It failed for reasons that had nothing to do with the technology’s quality.
Cable companies didn’t want a sophisticated, open software platform. They wanted cheap, dumb boxes that they controlled completely. An open, portable platform that could run third-party software threatened their business model: they wanted to be gatekeepers, not platform hosts. The deals fell through, one after another. FirstPerson bid on a Time Warner interactive TV project and lost to Silicon Graphics. They explored deals with other cable operators and consumer electronics companies, but the interest was tepid at best.
By 1994, FirstPerson was dissolved. The team was folded back into Sun. Oak — this carefully designed, platform-independent, network-aware language — appeared to be a solution without a problem. James Gosling and his colleagues had built something genuinely innovative, and nobody wanted it.
Then the Internet happened.
The Pivot: How the World Wide Web Saved a Dead Project
To say the Internet “happened” in 1994 is a simplification, of course. The Internet had existed in various forms since the 1960s. But the World Wide Web — Tim Berners-Lee’s hypertext system built on top of the Internet — reached critical mass in 1993 and 1994 with the release of the Mosaic web browser. Mosaic, developed at the National Center for Supercomputing Applications (NCSA) at the University of Illinois, was the first browser to display images inline with text. It turned the web from an academic curiosity into something ordinary people could use and, more importantly, something they wanted to use.
The web grew explosively. By mid-1994, web traffic was doubling every few months. And several members of the former Green Project team — Naughton, Gosling, and others — noticed something striking: the web had exactly the characteristics that Oak was designed for. It was a network of heterogeneous machines. Users accessed content from every kind of computer: Windows PCs, Macintosh systems, Unix workstations, and more. The web needed a way to deliver not just static pages, but interactive content — little programs that could run safely inside a browser on any platform.
This was precisely the problem Oak solved. A platform-independent language, compiled to an intermediate bytecode that ran on a virtual machine, with built-in security features to prevent untrusted code from damaging the host system. The cable TV industry hadn’t wanted this. The web desperately needed it.

The team pivoted. They refocused Oak as a programming language for the web. There was one immediate problem with the name: a trademark search revealed that “Oak” was already taken by Oak Technology, a semiconductor company. The language needed a new name.
The naming process has become the stuff of industry legend, told slightly differently by everyone who was in the room. What’s generally agreed upon is that the team gathered for a brainstorming session and threw out dozens of names. Some of the candidates included Silk, DNA, Lyric, and Pepper. Someone suggested Java — a reference to Java coffee, the Indonesian island where much of the world’s coffee is grown, and a nod to the engineering team’s prodigious coffee consumption. (If you’ve ever noticed that Java’s logo is a steaming coffee cup, now you know why.) The name stuck, not because of any deep strategic reasoning, but because it sounded good, it was short, it was energetic, and — critically — it wasn’t already trademarked by someone else.
Java was born. Not from a grand strategic plan, but from a failed cable TV project, a timely coincidence, and a lot of coffee.
HotJava and the Applet Revolution
To demonstrate Java’s potential on the web, the team built HotJava, a web browser written entirely in Java. HotJava’s key innovation wasn’t the browser itself — Mosaic and its successor Netscape Navigator were already well established. The innovation was what HotJava could do that other browsers couldn’t: it could download and execute small Java programs, called applets, embedded directly in web pages.
Applets were transformative. In 1995, the web was almost entirely static. Web pages were documents — text and images arranged with HTML. If you wanted interactivity, your options were limited to simple HTML forms and CGI scripts running on the server. There was no animation, no real-time data visualization, no interactive content running on the client side. JavaScript existed only in its earliest, most rudimentary form.
Java applets changed that overnight. A developer could write a small Java program — an interactive chart, an animated simulation, a simple game, a chat client — compile it to bytecode, and embed it in a web page using an <applet> tag. When a user visited the page, the browser downloaded the applet’s bytecode and ran it on the local JVM. The applet ran inside a security sandbox that prevented it from accessing the local file system or making unauthorized network connections, which meant that executing downloaded code was (in theory) safe.
Sun demonstrated HotJava and Java applets publicly for the first time at the SunWorld conference on May 23, 1995. The response was electric. The tech press treated it as a paradigm shift, and they weren’t wrong — for the first time, the web was programmable on the client side.
The real tipping point came later that year when Netscape Communications, makers of the dominant Netscape Navigator browser, announced that they would license Java and integrate JVM support directly into Navigator. This was enormous. It meant that Java applets would run not just in Sun’s niche browser, but in the browser used by the majority of web users. Microsoft followed with JVM support in Internet Explorer. Suddenly, Java was everywhere.
Sun officially released Java 1.0 on January 23, 1996. The tagline — the promise — was four words that would define the language for decades.
”Write Once, Run Anywhere”: The Clever Trick That Made It Work
“Write Once, Run Anywhere” (WORA) is one of the most famous slogans in software history. It’s also one of the most misunderstood. Many people assume it means that all Java programs run on the same JVM — that Sun (and later Oracle) ships a single, universal runtime, and that’s why Java is portable. That’s not how it works at all. The mechanism is more clever, and more interesting, than that.
Here’s what actually happens.
When you write a Java program, you write source code in .java files. You then compile that source code using the Java compiler (javac), which produces .class files containing bytecode. Bytecode is not machine code for any particular processor. It’s machine code for a fictional processor — the Java Virtual Machine. The JVM is a specification, not a single piece of software. It defines an abstract computing machine: its instruction set, its memory model, how it loads and verifies classes, how it handles exceptions, and how it interacts with the underlying operating system.

Anyone can build a JVM. Sun built one. IBM built one. Oracle builds one today. Amazon, Microsoft, and Eclipse Adoptium all build their own. The JVM running on your Linux server was almost certainly compiled from different source code than the JVM running on your colleague’s MacBook. They are different programs, built by different teams, often written in different languages (most are written in C or C++, but GraalVM’s JIT compiler is written in Java itself).
So if everyone is running a different JVM, how does “Write Once, Run Anywhere” work? The answer lies in the Java Language Specification (JLS), the JVM Specification, and the Technology Compatibility Kit (TCK).
The JLS defines exactly how the Java language behaves. Not how a particular compiler implements it — how the language itself behaves. Every valid Java program must produce the same results regardless of which compliant compiler compiled it and which compliant JVM runs it.
The JVM Specification defines exactly how a conforming virtual machine must execute bytecode. It specifies the behavior of every instruction, the class-loading mechanism, the memory model, and the threading guarantees. Two different JVM implementations can use completely different internal architectures — different garbage collectors, different JIT compilation strategies, different memory layouts — but they must produce the same observable behavior for any given bytecode.
The TCK is the enforcement mechanism. It’s a massive suite of tests — tens of thousands of them — that any JVM implementation must pass to be certified as Java-compatible. You can build a JVM from scratch, using whatever internal architecture you like, but if it doesn’t pass the TCK, you can’t call it Java.
This three-layer system — language spec, VM spec, and compatibility tests — is the actual mechanism behind WORA. Your bytecode is portable not because every platform runs the same JVM, but because every certified JVM interprets the same bytecode according to the same specification, verified by the same compatibility tests. The abstraction layer isn’t a single shared program; it’s a shared contract.
This design had a profound consequence that went beyond simple portability. Because the JVM is a specification, it became a platform — a target for other languages. Today, Kotlin, Scala, Clojure, Groovy, and dozens of other languages compile to JVM bytecode and run on the same virtual machine infrastructure. The JVM outlived the applet era, outlived the browser wars, and became one of the most important runtime platforms in computing history — not because Sun shipped a single piece of software to every device, but because they published a specification rigorous enough that anyone could build a conforming implementation.
Java Goes Open Source: The OpenJDK Story
For its first decade, Java was proprietary software. Sun Microsystems controlled the language, the reference JVM implementation, the compiler, the standard class libraries, and — critically — the TCK. You could download the JDK for free and use it to build applications without paying Sun a dime. In that sense, Java was always free to use. But the source code of the platform itself was Sun’s intellectual property, governed by Sun’s licenses.
This created tension. The open-source movement was gaining enormous momentum through the 2000s. Linux had proven that community-driven development could produce world-class software. Apache, Mozilla, and countless other projects demonstrated that opening source code didn’t destroy commercial value — it often enhanced it. Java’s proprietary status increasingly looked like an anachronism, especially as competing platforms like Python and Ruby were fully open source from the start.
Sun took a significant step in 2006 when Jonathan Schwartz, Sun’s CEO, announced that Java would be released as open-source software. The process began in November 2006 and concluded in May 2007, when Sun released the bulk of the JDK source code under the GNU General Public License version 2 (GPL v2) with a special linking exception called the Classpath Exception. The project was named OpenJDK.
What Sun opened was substantial:
javac— the Java compiler.- HotSpot — the production virtual machine.
- The standard class libraries —
java.lang,java.util,java.io, and the rest. - The supporting tools —
javadoc,jar, the debugger, and friends.
The Classpath Exception was an important nuance — it meant that applications linking against the standard libraries weren’t forced to be GPL themselves. You could still write and distribute proprietary Java applications.
But what Sun didn’t fully open was equally important. The TCK — the compatibility test suite that determined whether a JVM implementation could legally call itself “Java” — remained under a proprietary license with restrictive terms. Sun licensed the TCK to some parties and refused it to others, most controversially to the Apache Software Foundation for their Apache Harmony project. This became a bitter dispute in the Java community, with critics arguing that Sun was paying lip service to open source while retaining a chokehold on the ecosystem through TCK licensing.
Some encumbered code — components that Sun had licensed from third parties and couldn’t legally open — also remained proprietary. These were gradually replaced by open-source alternatives over subsequent years, and by 2008, OpenJDK was substantially complete.
Despite these complications, the open-sourcing of Java was a watershed. It meant that the platform’s development was no longer solely in Sun’s hands. Developers from IBM, Red Hat, Apple, and eventually many other organizations began contributing to OpenJDK directly. The reference implementation of Java — the canonical version from which all others derived — was now open-source software.
Oracle Acquires Sun: A New Era, New Tensions
On April 20, 2009, Oracle Corporation announced its intention to acquire Sun Microsystems for approximately $7.4 billion. The deal closed on January 27, 2010. Overnight, Java’s steward changed from a hardware company with an engineering-first culture to the world’s largest enterprise database company, a corporation with a very different reputation regarding open source, intellectual property, and licensing.
The effects were immediate and lasting.
One of Oracle’s first major moves was to sue Google, alleging that Google’s Android operating system infringed Oracle’s Java-related patents and copyrights. The lawsuit, filed in August 2010, centered on Google’s use of the Java API structure in Android’s Dalvik virtual machine (later replaced by ART). The case wound through the courts for over a decade, reaching the U.S. Supreme Court, which ruled in Google’s favor in April 2021 — finding that Google’s use of the Java API constituted fair use. The case reshaped the legal landscape around API copyrightability and left a lasting mark on the relationship between Oracle and the broader developer community.
Oracle also changed Java’s release cadence and licensing model. Starting in 2017, Oracle shifted from the traditional multi-year release cycle (Java 6, 7, 8, with years between them) to a six-month feature release cadence. Java 9 arrived in September 2017, Java 10 in March 2018, Java 11 in September 2018, and so on. This accelerated the pace of language evolution considerably.
But the licensing changes were more consequential for many users. Beginning with Java 11 in September 2018, Oracle split its Java distribution into two tracks: Oracle JDK, distributed under the Oracle Technology Network (OTN) License, and Oracle’s OpenJDK builds, distributed under the open-source GPL v2 with Classpath Exception. The OTN license for Oracle JDK restricted commercial use without a paid subscription. This meant that organizations using Oracle JDK in production now needed to pay for the privilege — or switch to an alternative distribution.
For many enterprises, this felt like a rug pull. They had been using Oracle’s (and Sun’s before it) JDK for free in production for years. Now, Oracle was drawing a clear line: the open-source OpenJDK was free, but Oracle’s commercially supported, branded JDK required a subscription.
Oracle later adjusted its approach several times:
- 2018 — Oracle JDK 11 ships under the OTN license; free production use ends for the branded Oracle JDK.
- 2021 — Oracle introduces the NFTC (No-Fee Terms and Conditions) license for Oracle JDK 17+, permitting free production use again, with caveats.
- 2023 — Oracle moves to a per-employee subscription model for Java SE Universal Subscription, billed on total organizational headcount rather than number of Java installs.
Each change sent ripples of confusion through the Java community.
Oracle JDK vs. OpenJDK vs. Free Alternatives: What You Actually Need to Know
The single most common source of confusion for Java developers and organizations today is the question: “Is Java free?” The answer is yes — but with nuances that matter.
Here’s the key insight: Java, the language and platform, is open source. The OpenJDK project is the reference implementation of Java SE, released under GPL v2 with Classpath Exception. Anyone can download, use, modify, and redistribute it. You can build production applications with OpenJDK without paying anyone a cent, and you will be in full compliance with every relevant license.
What costs money isn’t the language or the platform. It’s the support contract. When Oracle (or another vendor) charges for a Java distribution, they’re selling long-term support (LTS), timely security patches for older versions, performance engineering, and legal indemnification — not access to the language itself.
Think of it like Linux. The Linux kernel is free and open source. But Red Hat Enterprise Linux (RHEL), which is built from the same kernel, costs money — because you’re paying for Red Hat’s engineering, testing, patching, and support infrastructure. Java works the same way.
Here’s how the major options compare:
The Comparison
| Oracle JDK | OpenJDK (Oracle builds) | Eclipse Temurin | Amazon Corretto | Microsoft OpenJDK | Azul Zulu | |
|---|---|---|---|---|---|---|
| Source code | OpenJDK (same base) | OpenJDK | OpenJDK | OpenJDK | OpenJDK | OpenJDK |
| License | Oracle NFTC (JDK 17+) or OTN (older); paid subscription available | GPL v2 + Classpath Exception | GPL v2 + Classpath Exception | GPL v2 + Classpath Exception | GPL v2 + Classpath Exception | GPL v2 + Classpath Exception (free tier) |
| Free for production? | Depends on version and license terms; verify current Oracle license | Yes | Yes | Yes | Yes | Yes (Community edition) |
| LTS versions | Yes (8, 11, 17, 21) | No (only current release) | Yes (8, 11, 17, 21) | Yes (8, 11, 17, 21) | Yes (11, 17, 21) | Yes (8, 11, 17, 21) |
| LTS security patches | Yes (paid subscription) | No | Yes (free) | Yes (free) | Yes (free) | Yes (free Community; paid Enterprise) |
| Commercial support | Yes (paid) | No | Available via Adoptium members | Included with AWS support plans | Included with Azure support | Yes (paid Azul Platform Prime) |
| TCK certified | Yes | Yes | Yes | Yes | Yes | Yes |
| Who backs it | Oracle | Oracle | Eclipse Foundation / Adoptium Working Group | Amazon | Microsoft | Azul Systems |
| Best suited for | Enterprises needing Oracle-backed SLAs and legal indemnification | Development, CI/CD, short-lived environments | General production use, broad community backing | AWS-centric environments | Azure-centric environments | Organizations wanting dedicated Java-focused vendor support |
Every distribution in this table is built from the same OpenJDK source code. They all pass the same TCK. A Java program compiled on one will run on any other. The differences are in who provides security patches, how long they maintain older versions, and what level of commercial support you can purchase.

What You Get for Paying Oracle
When an enterprise pays for Oracle’s Java SE subscription, they’re really paying for four things beyond the bits themselves:
- Extended long-term support. Oracle commits to security patches and bug fixes for LTS releases well beyond what free community builds offer.
- Guaranteed SLAs (Service-Level Agreements) for patch delivery — a contractual answer to “when will my CVE (Common Vulnerabilities and Exposures) be fixed?”.
- GraalVM Enterprise features — advanced JIT compilation and native-image capabilities not in the community build.
- Legal indemnification. Oracle’s contractual guarantee that they’ll defend you if someone sues you over Java IP claims.
For large enterprises in regulated industries, that last point alone can justify the cost.
What Most Developers and Teams Should Do
If you’re an individual developer, a startup, or a small-to-medium team, you almost certainly don’t need to pay for Java. Eclipse Temurin (from the Adoptium project) is the most vendor-neutral choice and has the broadest community support. Amazon Corretto is an excellent option if you’re running on AWS. Microsoft’s OpenJDK builds are well-maintained if you’re in the Azure ecosystem. All of these provide free LTS builds with security patches on a reasonable schedule.
The “free vs. paid Java” question, stripped of all complexity, comes down to this: the language, the compiler, the JVM, the libraries, and the right to use them in production are all free. What costs money is having a vendor answer the phone when something goes wrong at 3 AM, and having that vendor guarantee they’ll keep patching the version you’re running for the next decade. That’s a support contract, not a toll on the language.
The Thread That Runs Through It All
Java’s history is a story about survival through reinvention. A language designed for cable TV boxes that pivoted to the web. A proprietary platform that went open source. A Sun Microsystems project that outlived Sun Microsystems itself. At every inflection point — the failed set-top box pitch, the Netscape deal, the open-sourcing decision, the Oracle acquisition — Java didn’t just survive the transition. It emerged stronger, more widely adopted, and more deeply embedded in the infrastructure of modern computing.

Today, Java runs on an estimated three billion devices (if we’re being charitable with Sun’s old marketing claim) to well north of that (if we count Android’s lineage, enterprise servers, embedded systems, and cloud infrastructure). A short, incomplete list of where it lives:
- Most major banks — core ledgers, fraud engines, and trading risk systems.
- Stock exchanges — transaction engines where microseconds and correctness both matter.
- Netflix, LinkedIn, Amazon — large slices of their distributed backends.
- Android — Java’s most controversial offspring, powering most of the world’s smartphones.
- Enterprise servers, payment networks, and cloud infrastructure — quietly, almost invisibly, almost everywhere.
It started above a pizza shop. It was named after a tree, then after coffee. It was rejected by cable companies, embraced by the web, opened to the world, fought over in court, and forked into more distributions than most developers can name.
Not bad for a project that almost got cancelled.