Java Notes
Java evolved from Sun Microsystems
Java was created to solve a practical problem: software should be reliable and should not need to be rewritten for every type of computer. That idea explains many features still visible in Java today—bytecode, the JVM, automatic memory management, and strong compile-time checks.
The Green Project and Oak
In 1991, James Gosling, Mike Sheridan, and Patrick Naughton began the Green Project at Sun Microsystems. Their target was software for consumer and connected devices, where programs needed to work safely on different processors.
The language created during this project was first called Oak. It was designed to be smaller and safer than C++, with automatic memory management and a virtual-machine-based runtime. In 1995, Oak was renamed Java.
The original design problems and Java's answers are important:
| Problem at the time | Java's design response |
|---|---|
| Different hardware and operating systems | Compile source code into bytecode for the JVM. |
| Manual memory bugs in C and C++ programs | Use automatic garbage collection. |
| Unsafe downloaded programs | Use runtime checks, a managed runtime, and access controls. |
| Very complex language features | Keep a class-and-interface model with fewer low-level features. |
Java becomes public
Java was announced publicly in 1995. Its early popularity was strongly connected with the web because browsers could run small Java programs called applets. Applets are now obsolete and should not be used in new projects, but they helped introduce the phrase Write Once, Run Anywhere.
The first public development kit, JDK 1.0, arrived in 1996. Java then grew beyond browsers and became widely used for server applications, enterprise software, developer tools, and Android-related development.
From Oak to Java: the early story
The Green Project produced more than a programming language. Its team also built an experimental handheld device called Star7. The project did not become a consumer product, but it proved that the same program could be made portable across different devices when a virtual machine handled the platform-specific work.
The name Oak could not be used because it was already associated with another technology. The language was renamed Java in 1995. The new name was announced with a browser called HotJava, which demonstrated downloadable Java applets. The browser-and-applet era is historical context only: modern Java web development uses server-side applications, APIs, frameworks, and browser technologies—not applets.
Major Java milestones
| Year | Release or event | Why it matters |
|---|---|---|
| 1991 | Green Project starts | Portability, reliability, and security become Java's core goals. |
| 1995 | Java is announced | Oak is renamed Java; the JVM-based platform becomes public. |
| 1996 | JDK 1.0 | First public Java platform release. |
| 1997 | JDK 1.1 | Adds inner classes, JDBC, RMI, and a stronger event model. |
| 1998 | Java 2 / J2SE 1.2 | Introduces the Collections Framework and separates Java into platform editions. |
| 2000 | J2SE 1.3 | Brings the HotSpot JVM into the standard platform. |
| 2002 | J2SE 1.4 | Adds assertions, regular expressions, NIO, and XML APIs. |
| 2004 | Java 5 | Adds generics, annotations, enums, enhanced for, and autoboxing. |
| 2006–2007 | OpenJDK | Java's core implementation is released as open-source software. |
| 2010 | Oracle acquires Sun Microsystems | Oracle becomes responsible for Java's commercial stewardship. |
| 2011 | Java 7 | Adds try-with-resources, the diamond operator, and NIO.2. |
| 2014 | Java 8 | Adds lambdas, streams, java.time, and default interface methods. |
| 2017 | Java 9 | Adds the module system and begins the six-month release cycle. |
| 2018 | Java 11 (LTS) | First widely used LTS release after the new release cadence begins. |
| 2021 | Java 17 (LTS) | Becomes a widely adopted long-term support baseline. |
| 2023 | Java 21 (LTS) | Provides another modern long-term support baseline for new applications. |
LTS means Long-Term Support. Feature releases appear frequently, but LTS releases receive maintenance for longer. Companies commonly select an LTS release because upgrades can be planned more safely.
Java platform editions
When Java 2 was introduced, Java was described using three editions. You may still see these names in older books, job descriptions, or codebases.
| Historical name | Meaning | Modern context |
|---|---|---|
| J2SE | Java 2 Standard Edition | Became Java SE: the core language, JVM, and standard libraries. |
| J2EE | Java 2 Enterprise Edition | Became Java EE, then Jakarta EE: enterprise web and server specifications. |
| J2ME | Java 2 Micro Edition | A platform for constrained devices; it is mostly historical today. |
For this course, Java SE is the foundation. Collections, classes, exceptions, threads, file handling, and the JVM all belong to that foundation. Enterprise frameworks such as Spring build on Java SE.
Sun Microsystems, Oracle, and OpenJDK
Java was created at Sun Microsystems. In 2010, Oracle acquired Sun and became responsible for Java's commercial stewardship, trademarks, and the reference implementation process.
At the same time, the Java ecosystem is not controlled by one company alone. OpenJDK is the open-source implementation used as the basis for most modern JDK distributions. Oracle JDK, Eclipse Temurin, Amazon Corretto, Microsoft Build of OpenJDK, and Azul Zulu are examples of distributions built from, or closely aligned with, OpenJDK.
This is why you can install a JDK from more than one vendor while still writing and running standard Java code. For a beginner, the important requirement is to use a supported LTS JDK and keep the compiler and runtime versions compatible.
Why Java 5 and Java 8 matter
You will see Java code written before and after these releases. Java 5 made type-safe collections much easier to use with generics, while Java 8 introduced a new functional style with lambdas and streams.
Try it in WoHoCode
Edit the program, then run it here.
Run this example to see its output.
Run the example and confirm that both approaches produce the same total. A loop is often clearer when several steps or conditions are involved; a stream is useful when the transformation is short and declarative. History matters because real projects can contain both styles.
Code you may see in older projects
The age of a Java project often affects its style. This does not mean old code is automatically bad; it means you must understand when a feature was introduced.
| If you see this | It usually points to |
|---|---|
Raw collections such as List names = ... | Code written before generics in Java 5, or code that was never modernised. |
for (int i = 0; i < list.size(); i++) everywhere | A pre-Java-5 or traditional style; it can still be appropriate in some cases. |
| Anonymous inner classes for callbacks | A style common before Java 8 lambdas. |
Date and Calendar for all date work | Older APIs; modern code often uses java.time from Java 8. |
Modules in module-info.java | Java 9 or later. |
Modern Java releases
Since Java 9, a new Java feature release is normally published every six months. Not every release is intended as a long-lived production target. The important distinction is:
- Feature release: gives developers new language and platform features quickly.
- LTS release: receives a longer support window and is normally chosen for stable products.
For this course, use Java 21 or a later LTS JDK. The beginner syntax will work on older versions, but a current LTS release gives you modern tooling and better compatibility with current libraries. Do not select a JDK only because its number is newest: confirm that the project, framework, build tool, and deployment environment support it.
Check the installed version with:
java starts a Java program. javac compiles Java source code. Their major versions should be compatible.
Why the history matters when learning Java
Java has existed for decades, so tutorials, libraries, and production projects do not all use the same language level. Knowing the history helps you make sensible decisions:
- Use generics rather than raw collections in new code.
- Prefer the
java.timeAPI instead of old date-and-time classes for new code. - Learn both loops and streams; each is common in real Java programs.
- Use an LTS JDK unless a project has a stated requirement for another version.
- Treat applets, J2ME, and old browser-based Java examples as historical material, not a template for new software.
What to remember
- Java began as Oak during Sun Microsystems' Green Project in 1991.
- Java was announced in 1995, and JDK 1.0 was released in 1996.
- The JVM and bytecode were created to make Java portable across systems.
- Java 5, Java 8, Java 9, and modern LTS releases changed how Java programs are written and maintained.
- OpenJDK is the open-source basis for most current Java distributions.
- Choose an LTS JDK for learning and production work.
Continue the lesson path