Java at 25: Features that made an impact and a look to the future
My first experience with Java came in my second computer science class, Fundamentals of CS. The intro to programming course used C++, and was my first programming outside of BASIC. With the intro course, I learned loops and logic, variables and function declaration, memory allocation, and basic objects and classes.
After that, the CS department at CMU decided to switch to this brand new programming language, Java. It ran on any platform, which was great because the primary CS clusters were Solaris machines (a Unix variant put out by Sun). This was back before everyone had a Mac laptop that was also a Linux box. But it introduced me to a whole mess of other language features: threads, garbage collection, AWT (the abstract windows toolkit), exceptions, and object oriented programming.
Since then, Java has gone through roughly fourteen major feature releases,, transitioned between stewards with Oracle’s purchase of Sun Microsystems, open sourced the code behind the language, and spawned several languages that use its virtual machine, including Scala, Clojure, and Kotlin. Personally, I’ve worked for several companies that built complex products on Java, whether they were embedded in browsers, installed in desktops through WebStart, or behind the scenes in a service-oriented architecture backend.
1995 to 2020—that quarter century is saw the rise and fall of several epochs in the tech industry. I asked Georges Saab, Vice President of Software Development at Oracle’s Java Platform Group what changes to Java made the most impact and what upcoming features he believes will have a real affect on its future. Here’s some of the features that Saab feels made the language proliferate and a few that will keep it enduring.
High impact changes
The very first feature that made a massive impact wasn’t a change in the Java language at all. It was the vastly improved library support that happened in the early releases. Between 1.0 and 1.3, these libraries included the Swing window toolkit, the Collections framework, a RPC-like API for remote calls, JDBC for interacting with databases, and more. The standard libraries grew richer, more sophisticated, and allowed Java to become a real enterprise language.
In 2004, Java added generics, which allowed types, methods, and interfaces to be specified with the associated data types to be specified when that item was instantiated without sacrificing type safety. “At the time, generics were a challenge and people had strong opinions about them,” said Saab. Today, generics are one of the enduring features of the language.
Java may have been designed as a completely object oriented language, but when Java SE 8 was released in 2014, it added Lambda expressions (aka closures), which added some functional programming elements. Not every problem is best served by OOP, and by adding Lambdas, Java became more flexible.
Java 9 addressed the potential dependency issues that a pile of JAR files could lead to with modules. It allowed library code to be encapsulated so that when you import a package, you only import the module you need, not the whole JAR. Any dependencies that module has are explicitly declared, so you can check the code to see what code you’re importing. “Having them know that they’re not inadvertently depending on something is leading us to a point where the Java ecosystem is much more resilient towards change and constant evolution,” said Saab.
The bonus feature improvement is one that regular users may not have noticed: the performance of the JVM has been constantly improving. “You don’t necessarily see it happening, but what you see is the effect,” said Saab. “Code that I wrote that ran on J2SE 1.3 still runs on Java 14, but it’s just much, much faster. Not only is it faster, but it’s faster in a way takes advantage of changes in hardware that nobody had any idea were going to happen in 2004.”
What Java is brewing for the future
Despite its prominence across numerous industries, Java isn’t sitting still. Saab mentioned four big projects coming to Java that had him excited, all designated by codenames: Loom, Valhalla, Leyden, and ZGC.
The Loom project aims to loosen the coupling between Java threads and native threads. Java has had concurrency via threads from the beginning, but they were always tied to an OS thread. Loom introduces fibers, JVM-managed threads that allow more efficient concurrency. With Java server-side applications handling the load of thousands of simultaneous users, better concurrency can only improve web performance.
Valhalla aims to revise the memory model for Java to allow for immutable types, which are more complex than primitives, but less flexible than objects. Sometimes you have more complex data that doesn’t change over the course of that object’s lifespan; burdening it with the overhead of a class is unnecessary. The initial proposal put it more succinctly: “Codes like a class, works like an int.” “For things like big data for machine learning or for natural language, Valhalla promises to represent data in a way that allows the JVM to fully take advantage of modern hardware architectures that have changed dramatically since Java was created,” said Saab.
Leyden aims to address the startup time of Java applications. For monoliths and single applications, Java sometimes took a while to get going, but once up and running, they were fast. “That’s great if your app server is going to run for two weeks or two months or two years, but it’s not that great if you want to run for 30 milliseconds,” said Saab. Server-side software is getting smaller and more distributed, so quick starts are key to fast response times.
ZGC is a new garbage collector that can handle massive heap sizes, up to 16 terabytes in size, without an increase in pause time. For big data applications that may be processing massive amounts of data in-memory, keeping garbage collection pauses down below 10ms means that processing speed on large data sets won’t be stalled out by limitations in the language.
Java has grown to be integral to much of the modern internet and mobile app landscape, and promises to continue to be part of the information technology toolkit for some time in the future. A quarter century is an eternity in programming, so raise a `class` to Java, past, present, and future.
If you want to learn more, Oracle has put together a wealth of resources to celebrate Java’s 25th anniversary. If you want to check out part 1 of this series, you can find it here.
A written transcript of this podcast is available here.
Tags: java
12 Comments
00 min 53 secs: “…coding the Arduino” = underpinning the Arduino IDE, not the actual program running on the Arduino (that is (usually) written in a subset of C++).
Or in other words, Java is not running on the (classical) Arduino boards (the ones that are more like SBCs can of course do it).
Lambda [sic] expressions and closures are not quite the same thing. You could have a closure in Java using anonymous inner classes before lambda expressions were introduced to the language.
Java is a baby’s toy , native is the future. ironically before JAVA there was native. JAVA has just been a 25 year waste of time
Then perhaps you can explain your strategy for “write once, run anywhere” that still preserves modern conveniences like garbage collection and object orientation. Don’t have one? Didn’t think so.
Bjarne Stroustrup once said “There are only two kinds of languages: the ones people complain about and the ones nobody uses.”
>> Then perhaps you can explain your strategy for “write once, run anywhere” that still preserves modern conveniences
>> like garbage collection and object orientation. Don’t have one? Didn’t think so.
It’s funny… This year marks 28th years that I’ve been working as a software development, mostly in capital markets: across countless projects across countless banks, across multiple countries.. I have never, ever, even once, worked on, or even interacted with any projected where this “write once, run anywhere” was even a nice to have, never mind a requirement..
In my option, Java was invented as a solution to a non-existent problem.. Throughout the years it has shown itself to be rigid, verbose, and filled with limitations imposed by ideology rather than practical reality… Recently, it’s gotten better.. But I still prefer other languages…
I cant believe you think that..What is your secret that we don’t know because native is more trouble than anything else on most things but java seems to work because its always being updated…Just my Opinion
I’m curious about “This was back before everyone had a Mac laptop that was also a Linux box”. I guess I don’t count; I’ve never had a Mac laptop (I do have an old 1984 Macintosh in a closet somewhere). I remember when Java was first released to the world – and how it made it into Time magazine. I’d been doing dev work for about 15 years at the time (which is to say “I’m not a newbie”)
Definitely a “kids today” sort of thing. I think laptops are more prevalent in schools today, where back in my day, nobody had one. So we spent a lot of time in the computer labs. Some folks ended up sleeping there.
Mac laptop is actually a Unix box. Derived from Mach OS, which is derived from BSD Unix. Definitely not Linux.
Linux is much faster way to go and its a easy learning system and its available to make changes to anything unlike the others..Just my Opinion…We used our Brain when I was in school because there was 1 computer in the office and you had to get in line if you wanted to see how it worked..I never seen it one time because I was used to the God given thing we all have..Thank you
Leyden is a really big idea. It’s an idea that helps Java gain acceptance in the serverless world. For example, AWS Lambda or Google Functions.
Springboot is the only reason I still use Java. Not really fussed by the Java language itself – it’s all about the frameworks for me.
So I can see a future for springboot webapps, microservices, etc.
But as more parts of my infrastructure move to serverless, or to scripts, Java just can’t compete.
Ironically, it loses its main appeal: frameworks! They’re just too slow to include in an AWS lambda.
So I find myself doing more and more with Python.