Main image of article The State of Java Development in 2023

Twenty-eight years after it first appeared on the programming scene, Java is still in the top three or four most popular programming languages (at least according to the TIOBE Index, Redmonk and GitHub Octoverse). The exception is the StackOverflow's developer survey, which has it between fifth and seventh place depending on whether developers are learners, professional coders or not. In any case, if you’re a developer of any kind, Java is well worth learning.

But how has Java evolved in recent years? There have been a few changes, most notably in licensing. In 2021, the U.S. Supreme Court ruled in favor of Google in the Google v. Oracle API copyright case, in which Oracle accused Google of copyright infringement in the Android Java API. Ironically, this ruling might have saved Oracle a few dollars in the end, because Oracle's cloud storage service reimplements Amazon's S3 API; had Oracle won against Google, they’d possibly have been guilty of the same infringement.

Where can you learn Java?

If you’re interested in learning how to program in Java, there are lots of free materials online; check out this extensive tutorial on w3schools, for instance. The Java Developer Kit (JDK) has a good deal of built-in support and documentation, including extensive breakdowns of its libraries.

If you’re a visual learner, Microsoft also has a website featuring a series of short videos dedicated to the fundamentals of Java. There’s also a number of related skills to learn.

Licence Changes

In 2019, Oracle announced there'd be no more security updates without a support agreement. Two years later, Oracle announced that Java 17 and future versions of Java would be free, including commercial use. However, if you were using earlier versions, then you still have to pay for them. In January of this year, Oracle again changed their licensing and introduced a Java SE Universal Subscription. This is for use on desktop, server and cloud and replaces previous subscriptions.

There's a lot more to it, and you probably need an advanced degree in Oracle licensing to understand it in full. This article seems to cover pretty much everything; note that a big change in 2023 is that if you have one Java installation, you must license all your employees! According to redresscompliance, if you paid Oracle $48,000 in the past for 2,000 Java SE licences, you now need to pay $2.2 million! This might go some way to explaining Oracle’s buoyant revenues and profits.

Note: It’s a balance. Is it cheaper to pay the cost of decommissioning software or upgrading it and re-testing it on a later JDK or even switching to the OpenJDK, but without any security updates, then getting audited by Oracle and paying the licensing fees?

It seems the fear of being audited by Oracle has led to some companies preferring to overpay instead. It’s estimated that NASA could have saved approximately $35 million over the past five years in fines and overpayments ($20 million in penalties plus $15 million in Oracle overspend).

No more Official JREs

Since JDK 11, Oracle no longer provide a JRE (Java Runtime Environment). This was an optional install with the JDK which has been discontinued. The idea was the JDK had all the files developers needed, whereas the JRE had just the files needed to run Java apps.

Now, you should use jlink to create a reduced-size application; it's a tool that generates a custom Java runtime image containing only the platform modules that are required for a given application. Modules were introduced with Java 9 and contain a collection of packages and XML specifying which types and services are exported. That said, you can still obtain non-Oracle JREs from the likes of the Eclipse Foundation's Adoptimum.net website and others.

What's changed in Java over the past few years?

A bunch of relatively minor things such as sealed classes, record types, text blocks and defaulting to UTF-8 charset. The latest JDK (21) extends structured concurrency (still in preview mode). The intention here is to release a fully working form of concurrency with no bugs, or memory leaks. To this end, immutable data will be shareable across threads, a significant improvement on thread-local variables. And coming soon are virtual threads to prevent resource exhaustion in servers that use one thread per request.

Java’s quest to get away from massive variable declarations has now been extended, with compiler type inference for local variables with initializers using the var keyword.

What about Android and Java?

While Java continues to be the main development language for Android, Kotlin continues to gain popularity and has made it into the top 20 on StackOverflow, Redmonk and TIOBE Index. According to Google, Kotlin is already used by over 60 percent of professional Android developers, and 95 percent of the top 1,000 Android apps contain Kotlin code. In other words, Java is still dominant when it comes to Android development, but Kotlin is a growing presence.

Conclusions

Don't underestimate Oracle’s ability to make money. They reported $41 billion in revenue in 2022 and seem determined to milk every last cent from Java.

The whole Java licensing situation can be quite confusing, so if you’re unsure whether to stick with the Oracle JDK or go the OpenJDK route, follow this long-read article “Java is still free,” but bear in mind the January 2023 changes mentioned earlier.

Finally, if you like Visual Studio Code you can now get the official Oracle Java Platform extension.