Skip to content

Hey friend, which versions of Java can you still use for free in 2023?

I know you‘re a busy developer with more important things to worry about than Java licensing. But I also know how confusing and frustrating it can be trying to figure out which versions you can use freely vs which require complex commercial licenses.

Well, I‘ve got some good news for you! In this detailed guide, I‘ll clear up the licensing confusion once and for all so you can focus on what really matters – building great apps with Java!

Here‘s the quick summary:

  • Java 17 and above – completely free for commercial use! 🎉
  • Java 11 – free for development but needs a license for production
  • Java 8 – only free with OpenJDK, not Oracle‘s JDK

And yes, those older versions still matter because so many systems still run on them. But let‘s start from the beginning…

A Quick History of Java

Java has been around for a long time – since 1995! With such a long history, there are a ton of different versions out there. Let me give you a quick overview:

  • Java 1.0 – The very first release in 1996! Very basic compared to today.
  • Java 1.1 – Added some important features like inner classes.
  • Java 2 (Java 1.2) – A major release in 1998 with Swing GUI toolkit.
  • Java 5 (2004) – A huge release with generics, annotations, enums, etc.
  • Java 6 (2006) – Incremental improvements to Java 5.
  • Java 7 (2011) – Bigger release with Diamond operator, switch on String, try-with-resources.
  • Java 8 (2014) – Massive release, lambdas, streams, compact profiles.
  • Java 9 (2017) – Modularization of the JDK via Project Jigsaw.
  • Java 10 and 11 (2018) – Faster release cycle of every 6 months.
  • Java 17 (2021) – Long term support, free for production!

As you can see, Java 8 was a landmark release packed with major features like lambdas. And Java 17 is the current long term support (LTS) version that can be used freely.

Now let‘s clear up the licensing confusion…

Oracle JDK vs OpenJDK

There are two main Java distributions:

Oracle JDK – The official version from Oracle that is fully supported by them.

OpenJDK – Open source version that anyone can use, modify, distribute freely. Not officially supported by Oracle.

Here‘s what happened with licensing:

  • Before Java 11 – Oracle JDK was not open sourced and needed a license for commercial use. OpenJDK was free for all use cases as open source.

  • Java 11 – Oracle JDK open sourced but with a paid license for production. OpenJDK remained free.

  • Java 17 – Oracle JDK now free for production under a no-cost license! OpenJDK still free as open source.

So now in Java 17 and above, both options are free which is fantastic!

Which versions of Java are free in 2023?

Now let‘s clear up exactly which versions you can use for free based on whether you want Oracle‘s JDK or OpenJDK:

Java 8

  • Oracle JDK 8 – Free for personal use but needs a license for commercial use.
  • OpenJDK 8 – Totally free for anything including production!

Java 11

  • Oracle JDK 11 – Free for development but needs a license for production deployment.
  • OpenJDK 11 – Free for all uses including commercial production!

Java 17+

  • Oracle JDK 17+ – Free for all use cases including commercial use with no license needed! 🎉
  • OpenJDK 17+ – Also free for anything as open source.

Here are my recommendations if you‘re starting a new project today:

  • For production apps, use Java 17 or 19 to take advantage of the free Oracle JDK.
  • For development, you can use any version freely.
  • But ideally develop with Java 17 or 19 to leverage the latest features.

Let‘s dig into why Java 8 remains so popular despite being very old…

Why is Java 8 still widely used?

Java 8 was released way back in March 2014, yet it still dominates usage today! Why is it so stubbornly popular?

Long term support – Java 8 is an LTS release supported until at least 2030, giving amazing stability.

Important new features – Like lambdas, streams, compact profiles. Developers love these!

Familiarity and inertia – Developers don‘t want to upgrade from familiar old Java 8 code.

Ecosystem inertia – Libraries & frameworks are slow to upgrade and maintain Java 8 support.

This chart shows that Java 8 usage remains very high while adoption of newer versions is slowly growing:

Java VersionUsage
Java 868%
Java 1123%
Java 175%
Java 191%

So while moving from Java 8 takes work, for greenfield projects I‘d recommend Java 17 or 19 to get access to modern features and free licensing.

Can I still use Java 8 for free?

You often have no choice but to keep using Java 8 if you have legacy production systems running on it.

Here‘s what you need to know:

OpenJDK 8 – This can be used completely freely including for commercial use, since it‘s open source.

⛔️ Oracle JDK 8 – You can only use this for free for personal use or development. For production you need a license.

So if you have commercial apps running on Oracle‘s JDK 8, switch them over to the free OpenJDK distribution.

For development, Oracle JDK 8 remains free to use which is convenient.

Should you uninstall older Java versions?

Having old Java versions hang around can sometimes cause confusion or issues:

  • Apps might be accidentally using the wrong version
  • Older versions have more bugs/security issues
  • Harder to switch between versions

So as a best practice I recommend:

Remove older versions – Uninstall Java 6, 7, 8 etc from dev machines and upgrade apps to latest Java 17 where possible.

Use a version manager – This lets you safely switch between or install multiple versions side by side if needed.

But watch out, removing older Java could break tools or apps relying on those old versions. So test thoroughly!

Will Java become a paid service?

In the past, there were worries that Java would go the way of other platforms and become a paid cloud service.

However, the recent free licensing for production use in Java 17+ has put those concerns to rest.

Here‘s a quick history:

  • 2018 – Oracle announces commercial license needed for Java 11 production use. Caused uproar.

  • 2021 – Oracle reverses course and makes Java 17 free for production! OpenJDK remains free too.

So it seems Java will remain free and open for the foreseeable future. Oracle likely realized they would lose too many customers by making Java paid.

As evidence, Java remains as popular as ever according to the Tiobe index which tracks language usage:

YearJava Tiobe Ranking
20171
20181
20192
20202
20211
20221

Java has consistently ranked #1 or #2, proving it remains extremely relevant.

Is Java still a good choice in 2023?

Some people claim Java is outdated and not suited for modern development. I disagree! Here are a few reasons why Java remains a great choice:

  • Huge open source ecosystem – No language matches Java for open source libraries and tools. Critical for productivity.

  • Mature technology – The JVM is incredibly robust and optimized after decades of work. Crashes and memory issues are rare.

  • Universally known – Java is one of the most universally known languages making hiring and onboarding easier.

  • Enterprise backing – Nearly all large companies rely heavily on Java for their backend infrastructure and services.

  • Android native development – Want to build native Android apps? Java and Kotlin are your only options.

  • High performance – Java and the JVM allow building software that scales massively with high throughput and low latency.

So while excitements around languages like Go and Rust is understandable, Java remains a mature, robust, and versatile language that‘s here to stay.

Key Takeaways

Let‘s recap the key facts:

✅ Java 17+ is completely free for commercial use with no strings attached! Just choose Oracle JDK or OpenJDK.

✅ Java 11 is free for development but needs a license for production – use OpenJDK to avoid this.

✅ Java 8 requires a license for production use unless you use the free OpenJDK distribution.

I hope this detailed guide has cleared up the confusion around Java licensing! My recommendation:

For new projects, use Java 17+ to take full advantage of free licensing, a mature robust platform and the huge ecosystem.

For legacy systems, stick to open source OpenJDK distributions to avoid licensing costs.

What do you think? Are you upgrading to Java 17 yet or sticking with Java 8 and 11 for now? Let me know if you have any other questions!

nv-author-image

Michael

Michael Reddy is a tech enthusiast, entertainment buff, and avid traveler who loves exploring Linux and sharing unique insights with readers.