Java Development Kit: What Version of the JDK Should You Use?
Updated: Aug 9, 2019
The JDK or the Java Development Kit comes in many different versions. Usually if you're installing software, the general rule is just to grab the very latest version and use that and if an update comes through, just update to that version. But things aren't that simple with the Java Development Kit. The reason is firstly, we've got versions of the JDK that get released every six months and after the six months, they expire. Then we've also got this other concept of an LTS version, which is a Long-Term Support version of a JDK. So which version do you use? Confused yet? Well, let's go through which version you should be using in this discussion.
Let's talk about what version of the JDK we should be using.
You'll note that there are a lot of different vendors who each produce a version of their own Java Development Kit. We're not gonna talk about that in today's blog post. Now, we've got vendors like Oracle, Amazon, IBM, Red Hat, just to name a few, so they each produce their own version of the Java Development Kit but using the same version numbers so I need to create a separate post outlying which version or which vendor you should choose.
In this post, we'll stick to purely the version number you should be using so check outside this blog post, you'll see that on this website when I release it which will be the next article after this one. For now, let's talk about (again) which version of the JDK you should be using.
A new version of the JDK gets released, as I mentioned earlier, every six months. Now, when that new version is released at the expiry of the six months, the previous one expires. In other words, it's no longer supported and another version is basically released which takes its place. The thing to remember with the older version, is it no longer gets updated so you need to be careful in terms of which version you're choosing, for that reason.
Now, to give you a bit of a history, JDK version 9 came out in September 2017 and the JDK 10 got released in March 2018 which at the same time, JDK 9 expired and is no longer supported. JDK 11 got released in September 2018 but I'll come back to that shortly. The JDK 12 got released in March 2019, JDK 13 is going to be released in September 2019, and JDK 14 will be released in March 2020.
Going back to JDK version 11, I mentioned it was released in September 2018, but it's designated as the LTS, or Long-Term Support version of Java and consequently is gonna be supported with updates and commercial support if you want it, until at least 2026. Tthe reason that I'm bringing all this up is that large companies, software development firms and also large companies with an investment in Java, will generally use this version, the long-term support version because of that support but also to ensure that they don't have to chop and change their code base dramatically every six months.
Supporting each release of a JDK might be minor for a relatively small code base, if you haven't got a lot of source code, but if the existing code base is large and obviously, with a large company, they probably made significant investment in Java over the years, it might be a significant effort just maintaining compatibility with new releases of the Java Development Kit. Basically these larger companies have to balance that against adding new features of the software and that's obviously what their clients want. Usually, they're not particularly interested in which version of the JDK the software happens to be support or run under, they just want the new features that are being added. So, for this reason, large companies will stick to JDK 11 as a rule and that's because it's supported until at least 2026 but also there's no new features of the language introduced there. In other words, they don't have to risk breaking compatibility with that source code.
So, in general, having said all that, my advice is for you to be using JDK version 11. The new versions that are coming out, like for example, JDK 12, they introduce minor features of the language and if you're sticking to JDK 11, then you won't be able to use those new features that are coming out in JDK 12 and 13. But, the core Java language won't change that much in between the long-term support versions and the minor versions so keep that in mind and it's for that reason again that larger companies and your future employers will most likely be sticking to JDK 11.
Think of JDK 11 for large companies as sort of a line in the sand, in that they can, as I mentioned, focus on their product and new features they're adding to the code and not having to sort of deal with maintaining or having compatibility with the newer version of the JDK plus they've also got commercial support guaranteed to at least 2026.
Speaking of the long-term support versions, I mentioned that JDK 11 is the latest long-term support version supported to at least 2026. Well the current model is to release an LTS version of JDK every three years so consequently, the next LTS version - and that's your JDK 17 - is due September, 2021. In other words, in terms of supporting that long-term support, that would be the next base I suspect that most large companies will be focusing on. They'll be targeting the September 2021 release of JDK 17 as the next time to update. In other words, they'll move their code base from JDK 11 to JDK 17 at that point in time so that they've got a fixed agenda that they can actually focus on and they may even be on the site in between actually producing their software for their clients. They may even have some staff who are dedicated to just making sure that things are gonna be ready for JDK 17 so that may well be what they'll be doing. In any event, the thing is, my recommendation is to stick with JDK 11 right now.
I do realize that this isn't a perfect system because, if you wanna take advantage of some of the new features that have been introduced, (for example, JDK 12 has got a new switch expression feature which is pretty neat), we obviously can't use that sticking to JDK 11. It's a bit of give or take there. You gotta take the good with the bad so I think there are more reasons for you to to stick to JDK 11 because that's more than likely what your future employer is gonna be using when you switch across to them anyway. I think JDK 11, in general, is a good choice for most developers and, again, it's because most companies that you work for, or go to work for, will be using that.
All right, so that's what version of the JDK that I recommend and I actually said earlier in the post that I'm gonna create another blog article and it will be coming up after this one in a few days time. I'm gonna go through the vendors, the major companies or vendors that produce JDK's. I'm gonna help you decide which one you should go for and I mentioned a couple of companies like Oracle, we've also got Amazon, Azul, Open JDK, IBM and so on. It can get a bit confusing as to what version or which vendor you should be choosing but I'll go through the pros and cons and lead you, hopefully, to a decision on which way you can go.
Keep in mind then again, with all these vendors, they still use the same release number so in other words, they all have a JDK version 11 to stick to and they basically can change a few things up within each version of the JDK. For example, there might be a different runtime that you can select that's got better performance from a particular vendor but I'll go through all that in a future post.
The bottom line is that now you know which version JDK 11 to stick to so I'll see you in the next article.
Amazing, you made it to the end of this post! Thanks for reading! If you've got any questions, feel free to leave a comment and I'll get back to you.