Java: what it is and how it appeared
The Green project, an oak outside the window, the coffee cup logo and “write once, run anywhere”.
Java is one of the most widely used programming languages in the world. Banking systems, websites, Android apps and even Minecraft run on it. Here is what it is and where it came from.
What Java is
Java is a programming language and a platform for running programs. A program is written once and runs on Windows, macOS, Linux and others — thanks to the Java Virtual Machine (JVM).
The compiler turns source code not into machine code for a specific processor but into bytecode, which the JVM executes. Hence the famous “write once, run anywhere”.
How it appeared
In 1991 engineers at Sun Microsystems — James Gosling and his team — were looking for a language for consumer electronics: televisions, set-top boxes, remotes. The project was called Green, and the language was first named Oak after a tree outside the window.
The name was taken, so it became Java — after the coffee from the island of Java. That is where the cup logo comes from.
The first release and the internet
Java 1.0 shipped in 1995, just as the web took off: a Java program could run inside a browser — that is how applets appeared. Within a few years Java became the standard for enterprise systems.
Sun, Oracle and open source
In 2006 Sun open-sourced the platform. In 2010 Oracle bought the company and development continued under it. Today Java has regular releases: a new version every six months and a long-term support (LTS) release every two years, which companies standardise on.
Where Java runs
- Servers and banks: payment processing and large corporate systems.
- Android: apps have historically been written in Java and Kotlin.
- Education: Java is a common first language at universities.
- Games: Minecraft is written in Java.
- Big data: Hadoop and part of the data-analysis toolbox.
Strengths
- Cross-platform: one program, many systems.
- Strict typing: mistakes show up before the program crashes.
- A huge ecosystem of ready-made libraries.
- Automatic memory management: no manual object deletion.
A tiny example
The smallest Java program prints a greeting. It looks like this:
public class Hello {
public static void main(String[] args) {
String name = "World";
System.out.println("Hello, " + name + "!");
}
}What happens here:
- public class Hello — declares a class named Hello. The file must be called
Hello.java: the class and the file share the name. - public static void main(String[] args) — the entry point. Every program starts executing here.
- String name = "World"; — a variable
nameof type “string” holding the text “World”. - System.out.println(...) — prints to the console. The
+sign joins strings, so the output is “Hello, World!”. - Braces { } — the boundaries of the class and the method: everything inside belongs to them.
How to run it: save the file as Hello.java, then in that folder run javac Hello.java (compile) and java Hello (run). One line appears on the screen.
The lesson of the example: Java demands precision — every semicolon, brace and capital letter matters — but mistakes show up at compile time.
Weaknesses
- Verbosity: simple things take more lines of code.
- More memory-hungry than modern alternatives.
- Slow startup for large programs — a property of the JVM.
The essentials in a minute
- 1991 — the Green project and the language prototype.
- 1995 — Java 1.0 and applets.
- 2006 — open source; 2010 — Oracle.
- Java runs on the JVM: “write once, run anywhere”.